Useful extension methods for strings
public static class Korzh.EasyQuery.StringExtensions
Static Methods
Type | Name | Description |
---|---|---|
Int32 |
CompareToCI(this String s1, String s2) |
Compares two strings case-insatively . |
String |
GetSecondPart(this String s, Char sep) |
Gets the second part of the string divided by separator. If the separator is not included - the whole string is returned. |
String |
RemoveSymbols(this String str, Char[] symbolsToRemove) |
Removes the characters specified in the symbolsToRemove parameter and returns the modified string. |
Boolean |
SplitBy(this String s, Char sep, String& key, String& val) |
Split the string on 2 parts by some separator. |
Int32 |
ToInt(this String s, Int32 defValue = 0) |
Converts the string representation of a number to its 32-bit signed integer equivalent. This method does not throw an exception. Instead - it returns some pre-defined value for unsuccessful conversions. |
Int64 |
ToLong(this String s, Int64 defValue = 0) |
Converts the string representation of a number to its 64-bit signed integer equivalent. This method does not throw an exception. Instead - it returns some pre-defined value for unsuccessful conversions. |