Table of Contents

Class StringHelper

Inheritance
StringHelper
Inherited Members
Namespace
TabularEditor
Assembly
TOMWrapper.dll

Various string extension methods

public static class StringHelper

Methods

EqualsI(string, string)

Invariant Culture Ignore Case comparison between two strings.

public static bool EqualsI(this string str, string other)

Parameters

Type Name Description
string str
string other

Returns

Type Description
bool

EqualsTI(string, string)

Invariant Culture Ignore Case and trailing/leading whitespace comparison of two strings.

public static bool EqualsTI(this string current, string value)

Parameters

Type Name Description
string current
string value

Returns

Type Description
bool

FirstNLines(string, int, bool)

Returns the first N lines of a string, optionally adding an ellipsis if there are more lines.

public static string FirstNLines(this string value, int n, bool addEllipsis)

Parameters

Type Name Description
string value
int n
bool addEllipsis

Returns

Type Description
string

FormatInvariant(string, params object[])

Similar to string.Format but using invariant culture

public static string FormatInvariant(this string format, params object[] args)

Parameters

Type Name Description
string format
object[] args

Returns

Type Description
string

IsNumeric(string, bool)

Determines if a string represents a numeric value

public static bool IsNumeric(this string value, bool allowDecimals = false)

Parameters

Type Name Description
string value
bool allowDecimals

Returns

Type Description
bool

Left(string, int, bool)

Shortens a string from the left to the specified number of characters, optionally adding an ellipsis if the string contains more characters than that

public static string Left(this string value, int chars, bool addEllipsis = false)

Parameters

Type Name Description
string value
int chars
bool addEllipsis

Returns

Type Description
string

Replace(string, char[], char)

Replace any occurrence of characters with a specific chracter

public static string Replace(this string value, char[] find, char replace)

Parameters

Type Name Description
string value
char[] find
char replace

Returns

Type Description
string

Replace(string, char[], char[])

Replaces any occurrence of various chracters with a different character

public static string Replace(this string value, char[] find, char[] replace)

Parameters

Type Name Description
string value
char[] find
char[] replace

Returns

Type Description
string

Exceptions

ArgumentException

Replace(string, char[], string[])

Replaces any occurrence of various chracters with a different string

public static string Replace(this string value, char[] find, string[] replace)

Parameters

Type Name Description
string value
char[] find
string[] replace

Returns

Type Description
string

Exceptions

ArgumentException

Replace(string, string, string, StringComparison)

Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string.

public static string Replace(this string str, string oldValue, string newValue, StringComparison comparison)

Parameters

Type Name Description
string str

Current instance

string oldValue

The string to be replaced

string newValue

The string to replace all occurrences of oldValue

StringComparison comparison

One of the enumeration values that specifies the rules for the search

Returns

Type Description
string

Right(string, int)

Shortens a string from the right to the specified number of characters

public static string Right(this string value, int chars)

Parameters

Type Name Description
string value
int chars

Returns

Type Description
string

SplitCamelCase(string)

Splits a string typed as CamelCase (aka. PascalCase) into separate words.

public static string SplitCamelCase(this string str)

Parameters

Type Name Description
string str

Returns

Type Description
string