Class StringUtils
Utilities for converting objects to strings. Used by the marshaller classes.
public static class StringUtils
- Inheritance
-
StringUtils
- Inherited Members
Methods
FromBool(bool)
public static string FromBool(bool value)
Parameters
value
bool
Returns
FromDateTime(DateTime)
[Obsolete("This method doesn't handle correctly non-UTC DateTimes. Use FromDateTimeToISO8601 instead.", false)]
public static string FromDateTime(DateTime value)
Parameters
value
DateTime
Returns
FromDateTimeToISO8601(DateTime)
Converts a DateTime to ISO8601 formatted string.
public static string FromDateTimeToISO8601(DateTime value)
Parameters
value
DateTime
Returns
FromDateTimeToRFC822(DateTime)
Converts a DateTime to RFC822 formatted string.
public static string FromDateTimeToRFC822(DateTime value)
Parameters
value
DateTime
Returns
FromDateTimeToUnixTimestamp(DateTime)
Converts a DateTime to Unix epoch time formatted string.
public static string FromDateTimeToUnixTimestamp(DateTime value)
Parameters
value
DateTime
Returns
FromDecimal(decimal)
public static string FromDecimal(decimal value)
Parameters
value
decimal
Returns
FromDouble(double)
public static string FromDouble(double value)
Parameters
value
double
Returns
FromFloat(float)
public static string FromFloat(float value)
Parameters
value
float
Returns
FromInt(int)
public static string FromInt(int value)
Parameters
value
int
Returns
FromInt(int?)
public static string FromInt(int? value)
Parameters
value
int?
Returns
FromList(IEnumerable<Enum>)
Combines a list of enums into a comma-separated string to be marshalled as a header
public static string FromList(IEnumerable<Enum> values)
Parameters
values
IEnumerable<Enum>List of enums
Returns
- string
Header value representing the list of enums
FromList(IEnumerable<string>)
Combines a list of strings into a comma-separated string to be marshalled as a header
public static string FromList(IEnumerable<string> values)
Parameters
values
IEnumerable<string>List of strings
Returns
- string
Header value representing the list of strings
FromList(List<Enum>)
Combines a list of enums into a comma-separated string to be marshalled as a header
public static string FromList(List<Enum> values)
Parameters
Returns
- string
Header value representing the list of enums
FromList<T>(IEnumerable<T>)
Combines an enumerable of ConstantClass enums into a comma-separated string to be marshalled as a header
public static string FromList<T>(IEnumerable<T> values) where T : ConstantClass
Parameters
values
IEnumerable<T>List of enums
Returns
- string
Header value representing the list of enums
Type Parameters
T
FromList<T>(List<T>)
Combines a list of ConstantClass enums into a comma-separated string to be marshalled as a header
public static string FromList<T>(List<T> values) where T : ConstantClass
Parameters
values
List<T>List of enums
Returns
- string
Header value representing the list of enums
Type Parameters
T
FromLong(long)
public static string FromLong(long value)
Parameters
value
long
Returns
FromMemoryStream(MemoryStream)
public static string FromMemoryStream(MemoryStream value)
Parameters
value
MemoryStream
Returns
FromString(ConstantClass)
public static string FromString(ConstantClass value)
Parameters
value
ConstantClass
Returns
FromString(string)
public static string FromString(string value)
Parameters
value
string
Returns
FromStringWithSlashEncoding(string)
public static string FromStringWithSlashEncoding(string value)
Parameters
value
string
Returns
Utf8ByteLength(string)
public static long Utf8ByteLength(string value)
Parameters
value
string