Search Results for

    Show / Hide Table of Contents

    Class StringExtensions

    A set of extensions for System.String.

    Inheritance
    System.Object
    StringExtensions
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Exiled.API.Extensions
    Assembly: Exiled.API.dll
    Syntax
    public static class StringExtensions

    Methods

    | Improve this Doc View Source

    ExtractCommand(String)

    Extract command name and arguments from a System.String.

    Declaration
    public static (string commandName, string[] arguments) ExtractCommand(this string commandLine)
    Parameters
    Type Name Description
    System.String commandLine

    The System.String to extract from.

    Returns
    Type Description
    System.ValueTuple<System.String, System.String[]>

    Returns a System.ValueTuple containing the exctracted command name and arguments.

    | Improve this Doc View Source

    GetBefore(String, Char)

    Retrieves a string before a symbol from an input.

    Declaration
    public static string GetBefore(this string input, char symbol)
    Parameters
    Type Name Description
    System.String input

    The input.

    System.Char symbol

    The symbol.

    Returns
    Type Description
    System.String

    Substring before the symbol.

    | Improve this Doc View Source

    GetDistance(String, String)

    Compute the distance between two System.String.

    Declaration
    public static int GetDistance(this string firstString, string secondString)
    Parameters
    Type Name Description
    System.String firstString

    The first string to be compared.

    System.String secondString

    The second string to be compared.

    Returns
    Type Description
    System.Int32

    Returns the distance between the two strings.

    | Improve this Doc View Source

    GetHashedUserId(String)

    Gets a SHA256 hash of a player's user id without the authentication.

    Declaration
    public static string GetHashedUserId(this string userId)
    Parameters
    Type Name Description
    System.String userId

    The user id.

    Returns
    Type Description
    System.String

    The hashed userid.

    | Improve this Doc View Source

    GetRawUserId(String)

    Gets the player's user id without the authentication.

    Declaration
    public static string GetRawUserId(this string userId)
    Parameters
    Type Name Description
    System.String userId

    The user id.

    Returns
    Type Description
    System.String

    Returns the raw user id.

    | Improve this Doc View Source

    RemoveBracketsOnEndOfName(String)

    Removes the prefab-generated brackets (#) on UnityEngine.GameObject names.

    Declaration
    public static string RemoveBracketsOnEndOfName(this string name)
    Parameters
    Type Name Description
    System.String name

    Name of the UnityEngine.GameObject.

    Returns
    Type Description
    System.String

    Name without brackets.

    | Improve this Doc View Source

    RemoveSpaces(String)

    Removes all space symbols from string.

    Declaration
    public static string RemoveSpaces(this string input)
    Parameters
    Type Name Description
    System.String input

    Input string.

    Returns
    Type Description
    System.String

    String without spaces.

    | Improve this Doc View Source

    SplitCamelCase(String)

    Splits camel case string to space-separated words. Ex: SomeCamelCase -> Some Camel Case.

    Declaration
    public static string SplitCamelCase(this string input)
    Parameters
    Type Name Description
    System.String input

    Camel case string.

    Returns
    Type Description
    System.String

    Splitted string.

    | Improve this Doc View Source

    ToSnakeCase(String, Boolean)

    Converts a System.String to snake_case convention.

    Declaration
    public static string ToSnakeCase(this string str, bool shouldReplaceSpecialChars = true)
    Parameters
    Type Name Description
    System.String str

    The string to be converted.

    System.Boolean shouldReplaceSpecialChars

    Indicates whether special chars has to be replaced or not.

    Returns
    Type Description
    System.String

    Returns the new snake_case string.

    | Improve this Doc View Source

    ToString<T>(IEnumerable<T>, Boolean)

    Converts an System.Collections.Generic.IEnumerable<T> into a string.

    Declaration
    public static string ToString<T>(this IEnumerable<T> enumerable, bool showIndex = true)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> enumerable

    The instance.

    System.Boolean showIndex

    Indicates whether the enumerator index should be shown or not.

    Returns
    Type Description
    System.String

    Returns the converted System.Collections.Generic.IEnumerable<T>.

    Type Parameters
    Name Description
    T

    The type of the IEnumerable.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX