Class StringExtensions
- Namespace
- CarinaStudio
- Assembly
- CarinaStudio.AppBase.Core.dll
Extensions for string.
public static class StringExtensions
- Inheritance
-
StringExtensions
- Inherited Members
Methods
GetFirstLine(string, bool)
Get the first line of he string.
public static string GetFirstLine(this string s, bool includeCarriageReturns = false)
Parameters
Returns
- string
The first line of he string.
GetLastLine(string, bool)
Get the last line of he string.
public static string GetLastLine(this string s, bool includeCarriageReturns = false)
Parameters
Returns
- string
The last line of he string.
HasMultipleLines(string)
Check whether the string consist of more than one lines or not.
public static bool HasMultipleLines(this string s)
Parameters
s
stringThe string.
Returns
- bool
True if the string consist of more than one lines.
LineCount(string)
Count number of lines of the string.
public static int LineCount(this string s)
Parameters
s
stringThe string.
Returns
- int
Number of lines of the string.
Pin(string, PointerAction<char>)
Get address of characters in given string and perform action.
public static void Pin(this string s, PointerAction<char> action)
Parameters
s
stringaction
PointerAction<char>Action to perform.
Pin(string, Action<IntPtr>)
Get address of characters in given string and perform action.
public static void Pin(this string s, Action<IntPtr> action)
Parameters
Pin<R>(string, PointerInFunc<char, R>)
Get address of characters in given string and generate value.
public static R Pin<R>(this string s, PointerInFunc<char, R> func)
Parameters
s
stringfunc
PointerInFunc<char, R>Function to generate value.
Returns
- R
Generated value.
Type Parameters
R
Type of generated value.
Pin<R>(string, Func<IntPtr, R>)
Get address of characters in given string and generate value.
public static R Pin<R>(this string s, Func<IntPtr, R> func)
Parameters
Returns
- R
Generated value.
Type Parameters
R
Type of generated value.
RemoveLineBreaks(string, bool)
Remove all line breaks from the string.
public static string RemoveLineBreaks(this string s, bool removeCarriageReturns = true)
Parameters
Returns
- string
The string without line breaks.