Class
StringExtensions

Extension methods for working with strings

Definition

Namespace:Telerik.DataSource.Extensions

Assembly:Telerik.DataSource.dll

Syntax:

cs-api-definition
public static class StringExtensions

Inheritance: objectStringExtensions

Methods

AsTitle(string)

Returns the string In Title Case Formatting

Declaration

cs-api-definition
public static string AsTitle(this string value)

Parameters

value

string

Returns

string

EscapeHtmlEntities(string)

Declaration

cs-api-definition
public static string EscapeHtmlEntities(this string html)

Parameters

html

string

Returns

string

FormatWith(string, params object[])

Replaces the format item in a specified System.String with the text equivalent of the value of a corresponding System.Object instance in a specified array.

Declaration

cs-api-definition
public static string FormatWith(this string instance, params object[] args)

Parameters

instance

string

A string to format.

args

object[]

An System.Object array containing zero or more objects to format.

Returns

string

A copy of format in which the format items have been replaced by the System.String equivalent of the corresponding instances of System.Object in args.

HasValue(string)

Declaration

cs-api-definition
public static bool HasValue(this string value)

Parameters

value

string

Returns

bool

IsCaseInsensitiveEqual(string, string)

Determines whether this instance and another specified System.String object have the same value.

Declaration

cs-api-definition
public static bool IsCaseInsensitiveEqual(this string instance, string comparing)

Parameters

instance

string

The string to check equality.

comparing

string

The comparing with string.

Returns

bool

true if the value of the comparing parameter is the same as this string; otherwise, false.

IsCaseSensitiveEqual(string, string)

Determines whether this instance and another specified System.String object have the same value.

Declaration

cs-api-definition
public static bool IsCaseSensitiveEqual(this string instance, string comparing)

Parameters

instance

string

The string to check equality.

comparing

string

The comparing with string.

Returns

bool

true if the value of the comparing parameter is the same as this string; otherwise, false.

JavaScriptStringEncode(string)

Escapes a string for use in JavaScript

Declaration

cs-api-definition
public static string JavaScriptStringEncode(this string value)

Parameters

value

string

Returns

string

JavaScriptStringEncode(string, bool)

Escapes a string for JavaScript by wrapping it in " symbols if true is passed, otherwise returns the original string.

Declaration

cs-api-definition
public static string JavaScriptStringEncode(this string value, bool addDoubleQuotes)

Parameters

value

string

addDoubleQuotes

bool

Returns

string

SplitPascalCase(string)

Splits a string to space-separated words in Pascal Case

Declaration

cs-api-definition
public static string SplitPascalCase(this string value)

Parameters

value

string

Returns

string

ToCamelCase(string)

Returns the string in camelCase casing

Declaration

cs-api-definition
public static string ToCamelCase(this string instance)

Parameters

instance

string

Returns

string

ToEnum<T>(string, T)

Returns the enum member the string parses to

Declaration

cs-api-definition
public static T ToEnum<T>(this string value, T defaultValue)

Parameters

value

string

defaultValue

T

Returns

T