StringUtils
Assembly: ServiceStack.Common.dll
View Source
Declaration
public static class StringUtils
Fields
EscapedCharMap
View Source
Declaration
public static readonly Dictionary<char, string> EscapedCharMap
NewLineMemory
View Source
Declaration
public static ReadOnlyMemory<char> NewLineMemory
HtmlCharacterCodes
View Source
Declaration
public static readonly IDictionary<string, string> HtmlCharacterCodes
Methods
ParseCommands(String)
View Source
Declaration
public static List<Command> ParseCommands(this string commandsString)
Returns
System.Collections.Generic.List<ServiceStack.Command>
Parameters
Type | Name |
---|---|
System.String | commandsString |
ParseCommands(ReadOnlyMemory<Char>, Char)
View Source
Declaration
public static List<Command> ParseCommands(this ReadOnlyMemory<char> commandsString, char separator = ',')
Returns
System.Collections.Generic.List<ServiceStack.Command>
Parameters
Type | Name |
---|---|
ReadOnlyMemory<System.Char> | commandsString |
System.Char | separator |
ParseArguments(ReadOnlyMemory<Char>, out List<ReadOnlyMemory<Char>>)
View Source
Declaration
public static ReadOnlyMemory<char> ParseArguments(ReadOnlyMemory<char> argsString, out List<ReadOnlyMemory<char>> args)
Returns
ReadOnlyMemory<System.Char>
Parameters
Type | Name |
---|---|
ReadOnlyMemory<System.Char> | argsString |
System.Collections.Generic.List<ReadOnlyMemory<System.Char>> | args |
ReplacePairs(String, String[])
Multiple string replacements
View Source
Declaration
public static string ReplacePairs(string str, string[] replaceStringsPairs)
Returns
System.String
Parameters
Type | Name | Description |
---|---|---|
System.String | str |
|
| System.String[]
| replaceStringsPairs | Even number of old and new value pairs
|
ReplaceOutsideOfQuotes(String, String[])
Replace string contents outside of string quotes
View Source
Declaration
public static string ReplaceOutsideOfQuotes(this string str, params string[] replaceStringsPairs)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | str |
System.String[] | replaceStringsPairs |
SafeInput(String)
Protect against XSS by cleaning non-standard User Input
View Source
Declaration
public static string SafeInput(this string text)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | text |
ToEscapedString(String)
View Source
Declaration
public static string ToEscapedString(this string input)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | input |
SnakeCaseToPascalCase(String)
View Source
Declaration
public static string SnakeCaseToPascalCase(string snakeCase)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | snakeCase |
RemoveSuffix(String, String)
View Source
Declaration
public static string RemoveSuffix(string name, string suffix)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | name |
System.String | suffix |
HtmlEncodeLite(String)
View Source
Declaration
public static string HtmlEncodeLite(this string html)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | html |
HtmlEncode(String)
View Source
Declaration
public static string HtmlEncode(this string html)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | html |
HtmlDecode(String)
View Source
Declaration
public static string HtmlDecode(this string html)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | html |
ConvertHtmlCodes(String)
View Source
Declaration
public static string ConvertHtmlCodes(this string html)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | html |
ToChar(Int32)
View Source
Declaration
public static string ToChar(this int codePoint)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Int32 | codePoint |
SplitVarNames(String)
View Source
Declaration
public static string[] SplitVarNames(string fields)
Returns
System.String[]
Parameters
Type | Name |
---|---|
System.String | fields |
SplitGenericArgs(String)
View Source
Declaration
public static List<string> SplitGenericArgs(string argList)
Returns
System.Collections.Generic.List<System.String>
Parameters
Type | Name |
---|---|
System.String | argList |
ParseTypeIntoNodes(String)
View Source
Declaration
public static TextNode ParseTypeIntoNodes(this string typeDef)
Returns
Parameters
Type | Name |
---|---|
System.String | typeDef |
ParseTypeIntoNodes(String, Char[])
View Source
Declaration
public static TextNode ParseTypeIntoNodes(this string typeDef, char[] genericDelimChars)
Returns
Parameters
Type | Name |
---|---|
System.String | typeDef |
System.Char[] | genericDelimChars |
AppendLine(StringBuilder, ReadOnlyMemory<Char>)
View Source
Declaration
public static void AppendLine(this StringBuilder sb, ReadOnlyMemory<char> line)
Parameters
Type | Name |
---|---|
System.Text.StringBuilder | sb |
ReadOnlyMemory<System.Char> | line |