Class ExtensionsString
Inheritance
ExtensionsString
Assembly: Acoustics.Shared.dll
Syntax
public static class ExtensionsString
Methods
|
Improve this Doc
View Source
ByteArrayToString(Byte[], Encoding)
Declaration
public static string ByteArrayToString(this byte[] bytes, Encoding encoding)
Parameters
Type |
Name |
Description |
Byte[] |
bytes |
The bytes.
|
Encoding |
encoding |
The encoding.
|
Returns
|
Improve this Doc
View Source
Contains(String, String, StringComparison)
Contains overload allowing a StringComparison to be specified (easier case-insensitive string compare).
Declaration
public static bool Contains(this string source, string toCheck, StringComparison comp)
Parameters
Returns
Type |
Description |
Boolean |
True if source contains toCheck using comp , otherwise false.
|
|
Improve this Doc
View Source
Declaration
public static string Format(this string format, params object[] args)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static string Format2(this string format, params object[] args)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static string FormatList<T>(this IEnumerable<T> strings)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
FormatList<T>(IEnumerable<T>, StringBuilder)
Declaration
public static void FormatList<T>(this IEnumerable<T> strings, StringBuilder builder)
Parameters
Type Parameters
|
Improve this Doc
View Source
IsGuid(String)
Attempts to convert a string to a guid.
Declaration
public static bool IsGuid(this string s)
Parameters
Type |
Name |
Description |
String |
s |
String to convert.
|
Returns
Type |
Description |
Boolean |
Returns true if successful, otherwise false.
|
|
Improve this Doc
View Source
IsNotEmpty(String)
Declaration
public static bool IsNotEmpty(this string str)
Parameters
Type |
Name |
Description |
String |
str |
|
Returns
|
Improve this Doc
View Source
IsNotWhitespace(String)
Declaration
public static bool IsNotWhitespace(this string str)
Parameters
Type |
Name |
Description |
String |
str |
|
Returns
|
Improve this Doc
View Source
NormalizeDirectorySeparators(String)
Declaration
public static string NormalizeDirectorySeparators(this string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Returns
|
Improve this Doc
View Source
NormalizeToCrLf(String)
Declaration
public static string NormalizeToCrLf(this string str)
Parameters
Type |
Name |
Description |
String |
str |
|
Returns
|
Improve this Doc
View Source
ParseAsColor(String)
Declaration
public static Color ParseAsColor(this string str)
Parameters
Type |
Name |
Description |
String |
str |
|
Returns
Type |
Description |
SixLabors.ImageSharp.Color |
|
|
Improve this Doc
View Source
ParseCommaSeparatedList(String)
Convert comma separated list to List of string.
Declaration
public static List<string> ParseCommaSeparatedList(this string value)
Parameters
Type |
Name |
Description |
String |
value |
String to parse.
|
Returns
|
Improve this Doc
View Source
Prepend(String, String)
Declaration
public static string Prepend(this string first, string prefix)
Parameters
Returns
|
Improve this Doc
View Source
SplitOnAnyNewLine(String)
Declaration
public static string[] SplitOnAnyNewLine(this string str)
Parameters
Type |
Name |
Description |
String |
str |
|
Returns
|
Improve this Doc
View Source
StringToUtf8ByteArray(String)
Converts the String to UTF8 Byte array.
Declaration
public static byte[] StringToUtf8ByteArray(this string string)
Parameters
Type |
Name |
Description |
String |
string |
The string to encode.
|
Returns
Type |
Description |
Byte[] |
Xml string as byte array.
|
|
Improve this Doc
View Source
StripEnd(String, String, StringComparison)
Declaration
public static string StripEnd(this string str, string suffix, StringComparison comparison = StringComparison.CurrentCulture)
Parameters
Returns
|
Improve this Doc
View Source
ToCamelCase(String)
Declaration
public static string ToCamelCase(this string source)
Parameters
Type |
Name |
Description |
String |
source |
|
Returns
|
Improve this Doc
View Source
ToCommaSeparatedList<T>(IEnumerable<T>)
Declaration
public static string ToCommaSeparatedList<T>(this IEnumerable<T> items)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ToKebabCase(String)
Declaration
public static string ToKebabCase(this string source)
Parameters
Type |
Name |
Description |
String |
source |
|
Returns
|
Improve this Doc
View Source
ToPascalCase(String)
Declaration
public static string ToPascalCase(this string source)
Parameters
Type |
Name |
Description |
String |
source |
|
Returns
|
Improve this Doc
View Source
ToSnakeCase(String)
Declaration
public static string ToSnakeCase(this string source)
Parameters
Type |
Name |
Description |
String |
source |
|
Returns
|
Improve this Doc
View Source
ToTrainCase(String)
Declaration
public static string ToTrainCase(this string source)
Parameters
Type |
Name |
Description |
String |
source |
|
Returns
|
Improve this Doc
View Source
Truncate(String, Int32, String, Boolean)
Truncate a string to a desired length, specifying an ellipsis to add if the text is longer than length.
Declaration
public static string Truncate(this string text, int length, string ellipsis, bool keepFullWordAtEnd)
Parameters
Type |
Name |
Description |
String |
text |
String to truncate.
|
Int32 |
length |
The length.
|
String |
ellipsis |
The ellipsis.
|
Boolean |
keepFullWordAtEnd |
The keep full word at end.
|
Returns
Type |
Description |
String |
Truncated string.
|
|
Improve this Doc
View Source
WordWrap(String, Int32, Int32, String, Boolean)
Declaration
public static string WordWrap(this string text, int wrapThreshold = 120, int leftPadding = 0, string splitOn = " ", bool keepSplit = false)
Parameters
Returns