Skip to main content

StringExtensions

Assembly: ServiceStack.Text.dll
View Source
Declaration
public static class StringExtensions

Methods

BaseConvert(String, Int32, Int32)

Converts from base: 0 - 62

View Source
Declaration
public static string BaseConvert(this string source, int from, int to)
Returns

System.String

Parameters
TypeNameDescription
System.StringsourceThe source.

| | System.Int32 | from | From.

| | System.Int32 | to | To.

|

EncodeXml(String)

View Source
Declaration
public static string EncodeXml(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

EncodeJson(String)

View Source
Declaration
public static string EncodeJson(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

EncodeJsv(String)

View Source
Declaration
public static string EncodeJsv(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

DecodeJsv(String)

View Source
Declaration
public static string DecodeJsv(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

UrlEncode(String, Boolean)

View Source
Declaration
public static string UrlEncode(this string text, bool upperCase = false)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.BooleanupperCase

UrlDecode(String)

View Source
Declaration
public static string UrlDecode(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

HexUnescape(String, Char[])

View Source
Declaration
public static string HexUnescape(this string text, params char[] anyCharOf)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Char[]anyCharOf

UrlFormat(String, String[])

View Source
Declaration
public static string UrlFormat(this string url, params string[] urlComponents)
Returns

System.String

Parameters
TypeName
System.Stringurl
System.String[]urlComponents

ToRot13(String)

View Source
Declaration
public static string ToRot13(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

UrlWithTrailingSlash(String)

View Source
Declaration
public static string UrlWithTrailingSlash(this string url)
Returns

System.String

Parameters
TypeName
System.Stringurl

WithTrailingSlash(String)

View Source
Declaration
public static string WithTrailingSlash(this string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

AppendPath(String, String[])

View Source
Declaration
public static string AppendPath(this string uri, params string[] uriComponents)
Returns

System.String

Parameters
TypeName
System.Stringuri
System.String[]uriComponents

AppendUrlPaths(String, String[])

View Source
Declaration
public static string AppendUrlPaths(this string uri, params string[] uriComponents)
Returns

System.String

Parameters
TypeName
System.Stringuri
System.String[]uriComponents

AppendUrlPathsRaw(String, String[])

View Source
Declaration
public static string AppendUrlPathsRaw(this string uri, params string[] uriComponents)
Returns

System.String

Parameters
TypeName
System.Stringuri
System.String[]uriComponents

FromUtf8Bytes(Byte[])

View Source
Declaration
public static string FromUtf8Bytes(this byte[] bytes)
Returns

System.String

Parameters
TypeName
System.Byte[]bytes

ToUtf8Bytes(String)

View Source
Declaration
public static byte[] ToUtf8Bytes(this string value)
Returns

System.Byte[]

Parameters
TypeName
System.Stringvalue

ToUtf8Bytes(Int32)

View Source
Declaration
public static byte[] ToUtf8Bytes(this int intVal)
Returns

System.Byte[]

Parameters
TypeName
System.Int32intVal

ToUtf8Bytes(Int64)

View Source
Declaration
public static byte[] ToUtf8Bytes(this long longVal)
Returns

System.Byte[]

Parameters
TypeName
System.Int64longVal

ToUtf8Bytes(UInt64)

View Source
Declaration
public static byte[] ToUtf8Bytes(this ulong ulongVal)
Returns

System.Byte[]

Parameters
TypeName
System.UInt64ulongVal

ToUtf8Bytes(Double)

View Source
Declaration
public static byte[] ToUtf8Bytes(this double doubleVal)
Returns

System.Byte[]

Parameters
TypeName
System.DoubledoubleVal

WithoutBom(String)

View Source
Declaration
public static string WithoutBom(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToBase64UrlSafe(Byte[])

View Source
Declaration
public static string ToBase64UrlSafe(this byte[] input)
Returns

System.String

Parameters
TypeName
System.Byte[]input

ToBase64UrlSafe(MemoryStream)

View Source
Declaration
public static string ToBase64UrlSafe(this MemoryStream ms)
Returns

System.String

Parameters
TypeName
System.IO.MemoryStreamms

FromBase64UrlSafe(String)

View Source
Declaration
public static byte[] FromBase64UrlSafe(this string input)
Returns

System.Byte[]

Parameters
TypeName
System.Stringinput

LeftPart(String, Char)

View Source
Declaration
public static string LeftPart(this string strVal, char needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Charneedle

LeftPart(String, String)

View Source
Declaration
public static string LeftPart(this string strVal, string needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Stringneedle

RightPart(String, Char)

View Source
Declaration
public static string RightPart(this string strVal, char needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Charneedle

RightPart(String, String)

View Source
Declaration
public static string RightPart(this string strVal, string needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Stringneedle

LastLeftPart(String, Char)

View Source
Declaration
public static string LastLeftPart(this string strVal, char needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Charneedle

LastLeftPart(String, String)

View Source
Declaration
public static string LastLeftPart(this string strVal, string needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Stringneedle

LastRightPart(String, Char)

View Source
Declaration
public static string LastRightPart(this string strVal, char needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Charneedle

LastRightPart(String, String)

View Source
Declaration
public static string LastRightPart(this string strVal, string needle)
Returns

System.String

Parameters
TypeName
System.StringstrVal
System.Stringneedle

SplitOnFirst(String, Char)

View Source
Declaration
public static string[] SplitOnFirst(this string strVal, char needle)
Returns

System.String[]

Parameters
TypeName
System.StringstrVal
System.Charneedle

SplitOnFirst(String, String)

View Source
Declaration
public static string[] SplitOnFirst(this string strVal, string needle)
Returns

System.String[]

Parameters
TypeName
System.StringstrVal
System.Stringneedle

SplitOnLast(String, Char)

View Source
Declaration
public static string[] SplitOnLast(this string strVal, char needle)
Returns

System.String[]

Parameters
TypeName
System.StringstrVal
System.Charneedle

SplitOnLast(String, String)

View Source
Declaration
public static string[] SplitOnLast(this string strVal, string needle)
Returns

System.String[]

Parameters
TypeName
System.StringstrVal
System.Stringneedle

WithoutExtension(String)

View Source
Declaration
public static string WithoutExtension(this string filePath)
Returns

System.String

Parameters
TypeName
System.StringfilePath

GetExtension(String)

View Source
Declaration
public static string GetExtension(this string filePath)
Returns

System.String

Parameters
TypeName
System.StringfilePath

ParentDirectory(String)

View Source
Declaration
public static string ParentDirectory(this string filePath)
Returns

System.String

Parameters
TypeName
System.StringfilePath

ToJsv<T>(T)

View Source
Declaration
public static string ToJsv<T>(this T obj)
Returns

System.String

Parameters
TypeName
<T>obj
Type Parameters
  • T

ToJsv<T>(T, Action<Config>)

View Source
Declaration
public static string ToJsv<T>(this T obj, Action<Config> configure)
Returns

System.String

Parameters
TypeName
<T>obj
System.Action<ServiceStack.Text.Config>configure
Type Parameters
  • T

ToSafeJsv<T>(T)

View Source
Declaration
public static string ToSafeJsv<T>(this T obj)
Returns

System.String

Parameters
TypeName
<T>obj
Type Parameters
  • T

FromJsv<T>(String)

View Source
Declaration
public static T FromJsv<T>(this string jsv)
Returns

<T>

Parameters
TypeName
System.Stringjsv
Type Parameters
  • T

FromJsvSpan<T>(ReadOnlySpan<Char>)

View Source
Declaration
public static T FromJsvSpan<T>(this ReadOnlySpan<char> jsv)
Returns

<T>

Parameters
TypeName
ReadOnlySpan<System.Char>jsv
Type Parameters
  • T

ToJson<T>(T, Action<Config>)

View Source
Declaration
public static string ToJson<T>(this T obj, Action<Config> configure)
Returns

System.String

Parameters
TypeName
<T>obj
System.Action<ServiceStack.Text.Config>configure
Type Parameters
  • T

ToJson<T>(T)

View Source
Declaration
public static string ToJson<T>(this T obj)
Returns

System.String

Parameters
TypeName
<T>obj
Type Parameters
  • T

ToSafeJson<T>(T)

View Source
Declaration
public static string ToSafeJson<T>(this T obj)
Returns

System.String

Parameters
TypeName
<T>obj
Type Parameters
  • T

FromJson<T>(String)

View Source
Declaration
public static T FromJson<T>(this string json)
Returns

<T>

Parameters
TypeName
System.Stringjson
Type Parameters
  • T

FromJsonSpan<T>(ReadOnlySpan<Char>)

View Source
Declaration
public static T FromJsonSpan<T>(this ReadOnlySpan<char> json)
Returns

<T>

Parameters
TypeName
ReadOnlySpan<System.Char>json
Type Parameters
  • T

ToCsv<T>(T)

View Source
Declaration
public static string ToCsv<T>(this T obj)
Returns

System.String

Parameters
TypeName
<T>obj
Type Parameters
  • T

ToCsv<T>(T, Action<Config>)

View Source
Declaration
public static string ToCsv<T>(this T obj, Action<Config> configure)
Returns

System.String

Parameters
TypeName
<T>obj
System.Action<ServiceStack.Text.Config>configure
Type Parameters
  • T

FromCsv<T>(String)

View Source
Declaration
public static T FromCsv<T>(this string csv)
Returns

<T>

Parameters
TypeName
System.Stringcsv
Type Parameters
  • T

FormatWith(String, Object[])

View Source
Declaration
public static string FormatWith(this string text, params object[] args)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Object[]args

Fmt(String, Object[])

View Source
Declaration
public static string Fmt(this string text, params object[] args)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Object[]args

Fmt(String, IFormatProvider, Object[])

View Source
Declaration
public static string Fmt(this string text, IFormatProvider provider, params object[] args)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.IFormatProviderprovider
System.Object[]args

Fmt(String, Object)

View Source
Declaration
public static string Fmt(this string text, object arg1)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Objectarg1

Fmt(String, Object, Object)

View Source
Declaration
public static string Fmt(this string text, object arg1, object arg2)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Objectarg1
System.Objectarg2

Fmt(String, Object, Object, Object)

View Source
Declaration
public static string Fmt(this string text, object arg1, object arg2, object arg3)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Objectarg1
System.Objectarg2
System.Objectarg3

StartsWithIgnoreCase(String, String)

View Source
Declaration
public static bool StartsWithIgnoreCase(this string text, string startsWith)
Returns

System.Boolean

Parameters
TypeName
System.Stringtext
System.StringstartsWith

EndsWithIgnoreCase(String, String)

View Source
Declaration
public static bool EndsWithIgnoreCase(this string text, string endsWith)
Returns

System.Boolean

Parameters
TypeName
System.Stringtext
System.StringendsWith

ReadAllText(String)

View Source
Declaration
public static string ReadAllText(this string filePath)
Returns

System.String

Parameters
TypeName
System.StringfilePath

FileExists(String)

View Source
Declaration
public static bool FileExists(this string filePath)
Returns

System.Boolean

Parameters
TypeName
System.StringfilePath

DirectoryExists(String)

View Source
Declaration
public static bool DirectoryExists(this string dirPath)
Returns

System.Boolean

Parameters
TypeName
System.StringdirPath

CreateDirectory(String)

View Source
Declaration
public static void CreateDirectory(this string dirPath)
Parameters
TypeName
System.StringdirPath

IndexOfAny(String, String[])

View Source
Declaration
public static int IndexOfAny(this string text, params string[] needles)
Returns

System.Int32

Parameters
TypeName
System.Stringtext
System.String[]needles

IndexOfAny(String, Int32, String[])

View Source
Declaration
public static int IndexOfAny(this string text, int startIndex, params string[] needles)
Returns

System.Int32

Parameters
TypeName
System.Stringtext
System.Int32startIndex
System.String[]needles

ExtractContents(String, String, String)

View Source
Declaration
public static string ExtractContents(this string fromText, string startAfter, string endAt)
Returns

System.String

Parameters
TypeName
System.StringfromText
System.StringstartAfter
System.StringendAt

ExtractContents(String, String, String, String)

View Source
Declaration
public static string ExtractContents(this string fromText, string uniqueMarker, string startAfter, string endAt)
Returns

System.String

Parameters
TypeName
System.StringfromText
System.StringuniqueMarker
System.StringstartAfter
System.StringendAt

StripHtml(String)

View Source
Declaration
public static string StripHtml(this string html)
Returns

System.String

Parameters
TypeName
System.Stringhtml

Quoted(String)

View Source
Declaration
public static string Quoted(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

StripQuotes(String)

View Source
Declaration
public static string StripQuotes(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

StripMarkdownMarkup(String)

View Source
Declaration
public static string StripMarkdownMarkup(this string markdown)
Returns

System.String

Parameters
TypeName
System.Stringmarkdown

ToCamelCase(String)

View Source
Declaration
public static string ToCamelCase(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToPascalCase(String)

View Source
Declaration
public static string ToPascalCase(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToTitleCase(String)

View Source
Declaration
public static string ToTitleCase(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToLowercaseUnderscore(String)

View Source
Declaration
public static string ToLowercaseUnderscore(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToKebabCase(String)

View Source
Declaration
public static string ToKebabCase(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToLowerSafe(String)

View Source
Declaration
public static string ToLowerSafe(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToUpperSafe(String)

View Source
Declaration
public static string ToUpperSafe(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

SafeSubstring(String, Int32)

View Source
Declaration
public static string SafeSubstring(this string value, int startIndex)
Returns

System.String

Parameters
TypeName
System.Stringvalue
System.Int32startIndex

SafeSubstring(String, Int32, Int32)

View Source
Declaration
public static string SafeSubstring(this string value, int startIndex, int length)
Returns

System.String

Parameters
TypeName
System.Stringvalue
System.Int32startIndex
System.Int32length

SubstringWithElipsis(String, Int32, Int32)

View Source
Declaration
[Obsolete("typo")]
public static string SubstringWithElipsis(this string value, int startIndex, int length)
Returns

System.String

Parameters
TypeName
System.Stringvalue
System.Int32startIndex
System.Int32length

SubstringWithEllipsis(String, Int32, Int32)

View Source
Declaration
public static string SubstringWithEllipsis(this string value, int startIndex, int length)
Returns

System.String

Parameters
TypeName
System.Stringvalue
System.Int32startIndex
System.Int32length

IsAnonymousType(Type)

View Source
Declaration
public static bool IsAnonymousType(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

CompareIgnoreCase(String, String)

View Source
Declaration
public static int CompareIgnoreCase(this string strA, string strB)
Returns

System.Int32

Parameters
TypeName
System.StringstrA
System.StringstrB

EndsWithInvariant(String, String)

View Source
Declaration
public static bool EndsWithInvariant(this string str, string endsWith)
Returns

System.Boolean

Parameters
TypeName
System.Stringstr
System.StringendsWith

ToEnum<T>(String)

View Source
Declaration
public static T ToEnum<T>(this string value)
Returns

<T>

Parameters
TypeName
System.Stringvalue
Type Parameters
  • T

ToEnumOrDefault<T>(String, T)

View Source
Declaration
public static T ToEnumOrDefault<T>(this string value, T defaultValue)
Returns

<T>

Parameters
TypeName
System.Stringvalue
<T>defaultValue
Type Parameters
  • T

SplitCamelCase(String)

View Source
Declaration
public static string SplitCamelCase(this string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

ToInvariantUpper(Char)

View Source
Declaration
public static string ToInvariantUpper(this char value)
Returns

System.String

Parameters
TypeName
System.Charvalue

ToEnglish(String)

View Source
Declaration
public static string ToEnglish(this string camelCase)
Returns

System.String

Parameters
TypeName
System.StringcamelCase

ToHttps(String)

View Source
Declaration
public static string ToHttps(this string url)
Returns

System.String

Parameters
TypeName
System.Stringurl

IsEmpty(String)

View Source
Declaration
public static bool IsEmpty(this string value)
Returns

System.Boolean

Parameters
TypeName
System.Stringvalue

IsNullOrEmpty(String)

View Source
Declaration
public static bool IsNullOrEmpty(this string value)
Returns

System.Boolean

Parameters
TypeName
System.Stringvalue

EqualsIgnoreCase(String, String)

View Source
Declaration
public static bool EqualsIgnoreCase(this string value, string other)
Returns

System.Boolean

Parameters
TypeName
System.Stringvalue
System.Stringother

ReplaceFirst(String, String, String)

View Source
Declaration
public static string ReplaceFirst(this string haystack, string needle, string replacement)
Returns

System.String

Parameters
TypeName
System.Stringhaystack
System.Stringneedle
System.Stringreplacement

ReplaceAll(String, String, String)

View Source
Declaration
[Obsolete("Use built-in string.Replace()")]
public static string ReplaceAll(this string haystack, string needle, string replacement)
Returns

System.String

Parameters
TypeName
System.Stringhaystack
System.Stringneedle
System.Stringreplacement

ContainsAny(String, String[])

View Source
Declaration
public static bool ContainsAny(this string text, params string[] testMatches)
Returns

System.Boolean

Parameters
TypeName
System.Stringtext
System.String[]testMatches

ContainsAny(String, String[], StringComparison)

View Source
Declaration
public static bool ContainsAny(this string text, string[] testMatches, StringComparison comparisonType)
Returns

System.Boolean

Parameters
TypeName
System.Stringtext
System.String[]testMatches
System.StringComparisoncomparisonType

IsValidVarName(String)

View Source
Declaration
public static bool IsValidVarName(this string name)
Returns

System.Boolean

Parameters
TypeName
System.Stringname

IsValidVarRef(String)

View Source
Declaration
public static bool IsValidVarRef(this string name)
Returns

System.Boolean

Parameters
TypeName
System.Stringname

SafeVarName(String)

View Source
Declaration
public static string SafeVarName(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

SafeVarRef(String)

View Source
Declaration
public static string SafeVarRef(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

Join(List<String>)

View Source
Declaration
public static string Join(this List<string> items)
Returns

System.String

Parameters
TypeName
System.Collections.Generic.List<System.String>items

Join(List<String>, String)

View Source
Declaration
public static string Join(this List<string> items, string delimiter)
Returns

System.String

Parameters
TypeName
System.Collections.Generic.List<System.String>items
System.Stringdelimiter

ToParentPath(String)

View Source
Declaration
public static string ToParentPath(this string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

RemoveCharFlags(String, Boolean[])

View Source
Declaration
public static string RemoveCharFlags(this string text, bool[] charFlags)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Boolean[]charFlags

ToNullIfEmpty(String)

View Source
Declaration
public static string ToNullIfEmpty(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

IsUserType(Type)

View Source
Declaration
public static bool IsUserType(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsUserEnum(Type)

View Source
Declaration
public static bool IsUserEnum(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsSystemType(Type)

View Source
Declaration
public static bool IsSystemType(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsTuple(Type)

View Source
Declaration
public static bool IsTuple(this Type type)
Returns

System.Boolean

Parameters
TypeName
System.Typetype

IsInt(String)

View Source
Declaration
public static bool IsInt(this string text)
Returns

System.Boolean

Parameters
TypeName
System.Stringtext

ToInt(String)

View Source
Declaration
public static int ToInt(this string text)
Returns

System.Int32

Parameters
TypeName
System.Stringtext

ToInt(String, Int32)

View Source
Declaration
public static int ToInt(this string text, int defaultValue)
Returns

System.Int32

Parameters
TypeName
System.Stringtext
System.Int32defaultValue

ToLong(String)

View Source
Declaration
public static long ToLong(this string text)
Returns

System.Int64

Parameters
TypeName
System.Stringtext

ToInt64(String)

View Source
Declaration
public static long ToInt64(this string text)
Returns

System.Int64

Parameters
TypeName
System.Stringtext

ToLong(String, Int64)

View Source
Declaration
public static long ToLong(this string text, long defaultValue)
Returns

System.Int64

Parameters
TypeName
System.Stringtext
System.Int64defaultValue

ToInt64(String, Int64)

View Source
Declaration
public static long ToInt64(this string text, long defaultValue)
Returns

System.Int64

Parameters
TypeName
System.Stringtext
System.Int64defaultValue

ToFloat(String)

View Source
Declaration
public static float ToFloat(this string text)
Returns

System.Single

Parameters
TypeName
System.Stringtext

ToFloatInvariant(String)

View Source
Declaration
public static float ToFloatInvariant(this string text)
Returns

System.Single

Parameters
TypeName
System.Stringtext

ToFloat(String, Single)

View Source
Declaration
public static float ToFloat(this string text, float defaultValue)
Returns

System.Single

Parameters
TypeName
System.Stringtext
System.SingledefaultValue

ToDouble(String)

View Source
Declaration
public static double ToDouble(this string text)
Returns

System.Double

Parameters
TypeName
System.Stringtext

ToDoubleInvariant(String)

View Source
Declaration
public static double ToDoubleInvariant(this string text)
Returns

System.Double

Parameters
TypeName
System.Stringtext

ToDouble(String, Double)

View Source
Declaration
public static double ToDouble(this string text, double defaultValue)
Returns

System.Double

Parameters
TypeName
System.Stringtext
System.DoubledefaultValue

ToDecimal(String)

View Source
Declaration
public static decimal ToDecimal(this string text)
Returns

System.Decimal

Parameters
TypeName
System.Stringtext

ToDecimalInvariant(String)

View Source
Declaration
public static decimal ToDecimalInvariant(this string text)
Returns

System.Decimal

Parameters
TypeName
System.Stringtext

ToDecimal(String, Decimal)

View Source
Declaration
public static decimal ToDecimal(this string text, decimal defaultValue)
Returns

System.Decimal

Parameters
TypeName
System.Stringtext
System.DecimaldefaultValue

Matches(String, String)

View Source
Declaration
public static bool Matches(this string value, string pattern)
Returns

System.Boolean

Parameters
TypeName
System.Stringvalue
System.Stringpattern

Glob(String, String)

View Source
Declaration
public static bool Glob(this string value, string pattern)
Returns

System.Boolean

Parameters
TypeName
System.Stringvalue
System.Stringpattern

GlobPath(String, String)

View Source
Declaration
public static bool GlobPath(this string filePath, string pattern)
Returns

System.Boolean

Parameters
TypeName
System.StringfilePath
System.Stringpattern

TrimPrefixes(String, String[])

View Source
Declaration
public static string TrimPrefixes(this string fromString, params string[] prefixes)
Returns

System.String

Parameters
TypeName
System.StringfromString
System.String[]prefixes

FromAsciiBytes(Byte[])

View Source
Declaration
public static string FromAsciiBytes(this byte[] bytes)
Returns

System.String

Parameters
TypeName
System.Byte[]bytes

ToAsciiBytes(String)

View Source
Declaration
public static byte[] ToAsciiBytes(this string value)
Returns

System.Byte[]

Parameters
TypeName
System.Stringvalue

ParseKeyValueText(String, String)

View Source
Declaration
public static Dictionary<string, string> ParseKeyValueText(this string text, string delimiter = " ")
Returns

System.Collections.Generic.Dictionary<System.String,System.String>

Parameters
TypeName
System.Stringtext
System.Stringdelimiter

ParseAsKeyValues(String, String)

View Source
Declaration
public static List<KeyValuePair<string, string>> ParseAsKeyValues(this string text, string delimiter = " ")
Returns

System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<System.String,System.String>>

Parameters
TypeName
System.Stringtext
System.Stringdelimiter

ReadLines(String)

View Source
Declaration
public static IEnumerable<string> ReadLines(this string text)
Returns

System.Collections.Generic.IEnumerable<System.String>

Parameters
TypeName
System.Stringtext

CountOccurrencesOf(String, Char)

View Source
Declaration
public static int CountOccurrencesOf(this string text, char needle)
Returns

System.Int32

Parameters
TypeName
System.Stringtext
System.Charneedle

NormalizeNewLines(String)

View Source
Declaration
public static string NormalizeNewLines(this string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

HexEscape(String, Char[])

View Source
Declaration
public static string HexEscape(this string text, params char[] anyCharOf)
Returns

System.String

Parameters
TypeName
System.Stringtext
System.Char[]anyCharOf

ToXml<T>(T)

View Source
Declaration
public static string ToXml<T>(this T obj)
Returns

System.String

Parameters
TypeName
<T>obj
Type Parameters
  • T

FromXml<T>(String)

View Source
Declaration
public static T FromXml<T>(this string json)
Returns

<T>

Parameters
TypeName
System.Stringjson
Type Parameters
  • T

ToHex(Byte[], Boolean)

View Source
Declaration
public static string ToHex(this byte[] hashBytes, bool upper = false)
Returns

System.String

Parameters
TypeName
System.Byte[]hashBytes
System.Booleanupper