Skip to main content

stringextensions-class

Useful extension methods for strings

public static class Korzh.EasyQuery.StringExtensions

Assembly: Korzh.EasyQuery.dll

Static Methods

NameTypeDescription
CompareToCI(this string s1, string s2)intCompares two strings case-insatively .
GetSecondPart(this string s, Char sep)stringGets the second part of the string divided by separator. If the separator is not included - the whole string is returned.
RemoveSymbols(this string str, Char[] symbolsToRemove)stringRemoves the characters specified in the symbolsToRemove parameter and returns the modified string.
SplitBy(this string s, Char sep, String& key, String& val)boolSplit the string on 2 parts by some separator.
ToInt(this string s, int defValue = 0)intConverts 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.
ToLong(this string s, long defValue = 0)longConverts 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.