Skip to main content

Class SeStringExtensions

Extension methods for SeStrings.

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

Methods

ToDalamudString(SeString)

Convert a Lumina SeString into a Dalamud SeString. This conversion re-parses the string.

View Source
Declaration
public static SeString ToDalamudString(this SeString originalString)
Returns

Dalamud.Game.Text.SeStringHandling.SeString: The re-parsed Dalamud SeString.

Parameters
TypeNameDescription
Lumina.Text.SeStringoriginalStringThe original Lumina SeString.

ToDalamudString(ReadOnlySeString)

Convert a Lumina ReadOnlySeString into a Dalamud SeString. This conversion re-parses the string.

View Source
Declaration
public static SeString ToDalamudString(this ReadOnlySeString originalString)
Returns

Dalamud.Game.Text.SeStringHandling.SeString: The re-parsed Dalamud SeString.

Parameters
TypeNameDescription
Lumina.Text.ReadOnly.ReadOnlySeStringoriginalStringThe original Lumina ReadOnlySeString.

ToDalamudString(ReadOnlySeStringSpan)

Convert a Lumina ReadOnlySeStringSpan into a Dalamud SeString. This conversion re-parses the string.

View Source
Declaration
public static SeString ToDalamudString(this ReadOnlySeStringSpan originalString)
Returns

Dalamud.Game.Text.SeStringHandling.SeString: The re-parsed Dalamud SeString.

Parameters
TypeNameDescription
Lumina.Text.ReadOnly.ReadOnlySeStringSpanoriginalStringThe original Lumina ReadOnlySeStringSpan.

AppendMacroString(SeStringBuilder, ReadOnlySpan<byte>)

Compiles and appends a macro string.

View Source
Declaration
public static SeStringBuilder AppendMacroString(this SeStringBuilder ssb, ReadOnlySpan<byte> macroString)
Returns

Dalamud.Game.Text.SeStringHandling.SeStringBuilder: this for method chaining.

Parameters
TypeNameDescription
Dalamud.Game.Text.SeStringHandling.SeStringBuilderssbTarget SeString builder.
System.ReadOnlySpan<System.Byte>macroStringMacro string in UTF-8 to compile and append to <code class="paramref">ssb</code>.

AppendMacroString(SeStringBuilder, ReadOnlySpan<char>)

Compiles and appends a macro string.

View Source
Declaration
public static SeStringBuilder AppendMacroString(this SeStringBuilder ssb, ReadOnlySpan<char> macroString)
Returns

Dalamud.Game.Text.SeStringHandling.SeStringBuilder: this for method chaining.

Parameters
TypeNameDescription
Dalamud.Game.Text.SeStringHandling.SeStringBuilderssbTarget SeString builder.
System.ReadOnlySpan<System.Char>macroStringMacro string in UTF-16 to compile and append to <code class="paramref">ssb</code>.

IsValidCharacterName(SeString)

Validate if character name is valid. Both forename and surname must be between 2 and 15 characters and not total more than 20 characters combined. Only letters, hyphens, and apostrophes can be used. The first character of either name must be a letter. Hyphens cannot be used in succession or placed immediately before or after apostrophes.

View Source
Declaration
public static bool IsValidCharacterName(this SeString value)
Returns

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

Parameters
TypeNameDescription
Dalamud.Game.Text.SeStringHandling.SeStringvaluecharacter name to validate.

IsTextOnly(ReadOnlySeString)

Determines whether the Lumina.Text.ReadOnly.ReadOnlySeString contains only text payloads.

View Source
Declaration
public static bool IsTextOnly(this ReadOnlySeString ross)
Returns

System.Boolean: true if the string contains only text payloads; otherwise, false.

Parameters
TypeNameDescription
Lumina.Text.ReadOnly.ReadOnlySeStringrossThe Lumina.Text.ReadOnly.ReadOnlySeString to check.

IsTextOnly(ReadOnlySeStringSpan)

Determines whether the Lumina.Text.ReadOnly.ReadOnlySeStringSpan contains only text payloads.

View Source
Declaration
public static bool IsTextOnly(this ReadOnlySeStringSpan rosss)
Returns

System.Boolean: true if the span contains only text payloads; otherwise, false.

Parameters
TypeNameDescription
Lumina.Text.ReadOnly.ReadOnlySeStringSpanrosssThe Lumina.Text.ReadOnly.ReadOnlySeStringSpan to check.

ContainsText(ReadOnlySeString, ReadOnlySpan<byte>)

Determines whether the Lumina.Text.ReadOnly.ReadOnlySeString contains the specified text.

View Source
Declaration
public static bool ContainsText(this ReadOnlySeString ross, ReadOnlySpan<byte> needle)
Returns

System.Boolean: true if the text is found; otherwise, false.

Parameters
TypeNameDescription
Lumina.Text.ReadOnly.ReadOnlySeStringrossThe Lumina.Text.ReadOnly.ReadOnlySeString to search.
System.ReadOnlySpan<System.Byte>needleThe text to find.

ContainsText(ReadOnlySeStringSpan, ReadOnlySpan<byte>)

Determines whether the Lumina.Text.ReadOnly.ReadOnlySeStringSpan contains the specified text.

View Source
Declaration
public static bool ContainsText(this ReadOnlySeStringSpan rosss, ReadOnlySpan<byte> needle)
Returns

System.Boolean: true if the text is found; otherwise, false.

Parameters
TypeNameDescription
Lumina.Text.ReadOnly.ReadOnlySeStringSpanrosssThe Lumina.Text.ReadOnly.ReadOnlySeStringSpan to search.
System.ReadOnlySpan<System.Byte>needleThe text to find.

ContainsText(SeStringBuilder, ReadOnlySpan<byte>)

Determines whether the Lumina.Text.SeStringBuilder contains the specified text.

View Source
Declaration
public static bool ContainsText(this SeStringBuilder builder, ReadOnlySpan<byte> needle)
Returns

System.Boolean: true if the text is found; otherwise, false.

Parameters
TypeNameDescription
Lumina.Text.SeStringBuilderbuilderThe builder to search.
System.ReadOnlySpan<System.Byte>needleThe text to find.

ReplaceText(ReadOnlySeString, ReadOnlySpan<byte>, ReadOnlySpan<byte>)

Replaces occurrences of a specified text in a Lumina.Text.ReadOnly.ReadOnlySeString with another text.

View Source
Declaration
public static ReadOnlySeString ReplaceText(this ReadOnlySeString ross, ReadOnlySpan<byte> toFind, ReadOnlySpan<byte> replacement)
Returns

Lumina.Text.ReadOnly.ReadOnlySeString: A new Lumina.Text.ReadOnly.ReadOnlySeString with the replacements made.

Parameters
TypeNameDescription
Lumina.Text.ReadOnly.ReadOnlySeStringrossThe original string.
System.ReadOnlySpan<System.Byte>toFindThe text to find.
System.ReadOnlySpan<System.Byte>replacementThe replacement text.

ReplaceText(SeStringBuilder, ReadOnlySpan<byte>, ReadOnlySpan<byte>)

Replaces occurrences of a specified text in an Lumina.Text.SeStringBuilder with another text.

View Source
Declaration
public static void ReplaceText(this SeStringBuilder builder, ReadOnlySpan<byte> toFind, ReadOnlySpan<byte> replacement)
Parameters
TypeNameDescription
Lumina.Text.SeStringBuilderbuilderThe builder to modify.
System.ReadOnlySpan<System.Byte>toFindThe text to find.
System.ReadOnlySpan<System.Byte>replacementThe replacement text.