Search Results for

    Show / Hide Table of Contents

    Class StringExtensions

    Defines a collection of extensions for string values.

    Inheritance
    System.Object
    StringExtensions
    Namespace: MADE.Data.Validation.Extensions
    Assembly: MADE.Data.Validation.dll
    Syntax
    public static class StringExtensions : object

    Methods

    | Improve this Doc View Source

    Contains(String, String, CompareOptions)

    Checks whether a phrase contains a specified value using a comparison option.

    Declaration
    public static bool Contains(this string phrase, string value, CompareOptions compareOption)
    Parameters
    Type Name Description
    System.String phrase

    The phrase to check.

    System.String value

    The value to find.

    CompareOptions compareOption

    The compare option.

    Returns
    Type Description
    System.Boolean

    True if the phrase contains the value; otherwise, false.

    | Improve this Doc View Source

    IsBoolean(String)

    Checks whether a string value is a boolean.

    Declaration
    public static bool IsBoolean(this string value)
    Parameters
    Type Name Description
    System.String value

    The value to check.

    Returns
    Type Description
    System.Boolean

    True if safely parses to a boolean; otherwise, false.

    | Improve this Doc View Source

    IsDouble(String)

    Checks whether a string value is a double.

    Declaration
    public static bool IsDouble(this string value)
    Parameters
    Type Name Description
    System.String value

    The value to check.

    Returns
    Type Description
    System.Boolean

    True if safely parses to a double; otherwise, false.

    | Improve this Doc View Source

    IsFloat(String)

    Checks whether a string value is a float.

    Declaration
    public static bool IsFloat(this string value)
    Parameters
    Type Name Description
    System.String value

    The value to check.

    Returns
    Type Description
    System.Boolean

    True if safely parses to a float; otherwise, false.

    | Improve this Doc View Source

    IsInt(String)

    Checks whether a string value is an integer.

    Declaration
    public static bool IsInt(this string value)
    Parameters
    Type Name Description
    System.String value

    The value to check.

    Returns
    Type Description
    System.Boolean

    True if safely parses to an integer; otherwise, false.

    | Improve this Doc View Source

    IsLike(String, String)

    Compares a string value against a wildcard pattern, similar to the Visual Basic like operator.

    Declaration
    public static bool IsLike(this string value, string likePattern)
    Parameters
    Type Name Description
    System.String value

    The value to compare is like.

    System.String likePattern

    The wildcard like pattern to match on.

    Returns
    Type Description
    System.Boolean

    True if the value is like the pattern; otherwise, false.

    Remarks

    An example of this in use comparing strings with * wildcard pattern.

      // result is true
      bool result = "MyValue".IsLike("My*");
      // result is false
      result = "MyValue".IsLike("Hello");
    | Improve this Doc View Source

    IsNullOrWhiteSpace(String)

    Indicates whether a specified string is null, empty, or consists only of white-space characters.

    Declaration
    public static bool IsNullOrWhiteSpace(this string value)
    Parameters
    Type Name Description
    System.String value

    The string to test.

    Returns
    Type Description
    System.Boolean

    True if the value parameter is null or empty, or if value consists exclusively of white-space characters.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps