Skip to main content

Class StringExtensions

Extension methods for strings.

Assembly: Dalamud.dll
View Source
Declaration
public static class StringExtensions

Methods

Format(string, params object[])

An extension method to chain usage of string.Format.

View Source
Declaration
public static string Format(this string format, params object[] args)
Returns

System.String: Formatted string.

Parameters
TypeNameDescription
System.StringformatFormat string.
System.Object[]argsFormat arguments.

IsNullOrEmpty(string?)

Indicates whether the specified string is null or an empty string ("").

View Source
Declaration
public static bool IsNullOrEmpty(this string? value)
Returns

System.Boolean: true if the value parameter is null or an empty string (""); otherwise, false.

Parameters
TypeNameDescription
System.StringvalueThe string to test.

IsNullOrWhitespace(string?)

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

View Source
Declaration
public static bool IsNullOrWhitespace(this string? value)
Returns

System.Boolean: true if the value parameter is null or an empty string (""), or if value consists exclusively of white-space characters.

Parameters
TypeNameDescription
System.StringvalueThe string to test.

IsValidCharacterName(string, bool)

Validate if character name is valid using game check.

View Source
Declaration
public static bool IsValidCharacterName(this string value, bool includeLegacy = true)
Returns

System.Boolean: indicator if character is name is valid.

Parameters
TypeNameDescription
System.Stringvaluecharacter name to validate.
System.BooleanincludeLegacyinclude legacy names (combined can be 30 instead of 20).