Table of Contents

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

s string

The string.

includeCarriageReturns bool

True to include Carriage Returns (CR) in the line.

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

s string

The string.

includeCarriageReturns bool

True to include Carriage Returns (CR) in the line.

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 string

The 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 string

The 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 string

string.

action 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

s string

string.

action Action<IntPtr>

Action to perform.

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 string

string.

func 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

s string

string.

func Func<IntPtr, R>

Function to generate value.

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

s string

The string.

removeCarriageReturns bool

True to remove Carriage Returns (CR) also.

Returns

string

The string without line breaks.