skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for ASP.NET AJAX UI for ASP.NET MVC UI for ASP.NET Core UI for Blazor UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Tools
    ThemeBuilder
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class StringExtensions

Extension methods for working with strings

Inheritance
System.Object
StringExtensions
Namespace: Telerik.DataSource.Extensions
Assembly: Telerik.DataSource.dll

Syntax

public static class StringExtensions : Object

Methods

AsTitle(String)

Returns the string In Title Case Formatting

Declaration
public static string AsTitle(this string value)
Parameters
System.String value

Returns
System.String

EscapeHtmlEntities(String)

Declaration
public static string EscapeHtmlEntities(this string html)
Parameters
System.String html

Returns
System.String

FormatWith(String, 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
public static string FormatWith(this string instance, params object[] args)
Parameters
System.String instance

A string to format.

System.Object[] args

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

Returns
System.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
public static bool HasValue(this string value)
Parameters
System.String value

Returns
System.Boolean

IsCaseInsensitiveEqual(String, String)

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

Declaration
public static bool IsCaseInsensitiveEqual(this string instance, string comparing)
Parameters
System.String instance

The string to check equality.

System.String comparing

The comparing with string.

Returns
System.Boolean

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
public static bool IsCaseSensitiveEqual(this string instance, string comparing)
Parameters
System.String instance

The string to check equality.

System.String comparing

The comparing with string.

Returns
System.Boolean

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
public static string JavaScriptStringEncode(this string value)
Parameters
System.String value

Returns
System.String

JavaScriptStringEncode(String, Boolean)

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

Declaration
public static string JavaScriptStringEncode(this string value, bool addDoubleQuotes)
Parameters
System.String value

System.Boolean addDoubleQuotes

Returns
System.String

SplitPascalCase(String)

Splits a string to space-separated words in Pascal Case

Declaration
public static string SplitPascalCase(this string value)
Parameters
System.String value

Returns
System.String

ToCamelCase(String)

Returns the string in camelCase casing

Declaration
public static string ToCamelCase(this string instance)
Parameters
System.String instance

Returns
System.String

ToEnum<T>(String, T)

Returns the enum member the string parses to

Declaration
public static T ToEnum<T>(this string value, T defaultValue)
Parameters
System.String value

T defaultValue

Returns
T

Type Parameters
T

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Client-side Blazor
  • Server-side Blazor
  • Demos
Community
  • Forums
  • Blogs
  • Feedback Portal
Support Resources
  • Demos
  • Knowledge Base
  • Samples Repo
  • Localizations Repo
Sample Applications
  • Dashboard
  • PWA - Stocks
  • PWA - Blazing Coffee Roasters

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.