Version 3.3.0.1

StringExtensions class

Namespace: Sirenix.Utilities
Assembly: Sirenix.Utilities
public static class StringExtensions
String method extensions.
Inheritance
  • System.Object
  • StringExtensions

Methods

CalculateLevenshteinDistance(String, String)
O(n*m) - Use with care.
public static int CalculateLevenshteinDistance(string source1, string source2)
Parameters
System.String source1

System.String source2

Returns
System.Int32

Contains(String, String, StringComparison)
Returns whether or not the specified string is contained with this string
public static bool Contains(this string source, string toCheck, StringComparison comparisonType)
Parameters
System.String source

System.String toCheck

System.StringComparison comparisonType

Returns
System.Boolean

IsNullOrWhitespace(String)
Returns true if this string is null, empty, or contains only whitespace.
public static bool IsNullOrWhitespace(this string str)
Parameters
System.String str

The string to check.

Returns
System.Boolean

true if this string is null, empty, or contains only whitespace; otherwise, false.

SplitPascalCase(String)
Ex: "thisIsCamelCase" -> "This Is Camel Case"
public static string SplitPascalCase(this string input)
Parameters
System.String input

Returns
System.String

ToTitleCase(String)
Eg MY_INT_VALUE => MyIntValue
public static string ToTitleCase(this string input)
Parameters
System.String input

Returns
System.String