Class SeStringExtensions
Extension methods for SeStrings.
Assembly: Dalamud.dll​
public static class SeStringExtensions
Methods​
ToDalamudString(ReadOnlySeString)​
Convert a Lumina ReadOnlySeString into a Dalamud SeString. This conversion re-parses the string.
public static SeString ToDalamudString(this ReadOnlySeString originalString)
Returns​
Dalamud.Game.Text.SeStringHandling.SeString: The re-parsed Dalamud SeString.
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.ReadOnly.ReadOnlySeString | originalString | The original Lumina ReadOnlySeString. |
ToDalamudString(ReadOnlySeStringSpan)​
Convert a Lumina ReadOnlySeStringSpan into a Dalamud SeString. This conversion re-parses the string.
public static SeString ToDalamudString(this ReadOnlySeStringSpan originalString)
Returns​
Dalamud.Game.Text.SeStringHandling.SeString: The re-parsed Dalamud SeString.
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.ReadOnly.ReadOnlySeStringSpan | originalString | The original Lumina ReadOnlySeStringSpan. |
AppendMacroString(SeStringBuilder, ReadOnlySpan<byte>)​
Compiles and appends a macro string.
public static SeStringBuilder AppendMacroString(this SeStringBuilder ssb, ReadOnlySpan<byte> macroString)
Returns​
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: this for method chaining.
Parameters​
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Text.SeStringHandling.SeStringBuilder | ssb | Target SeString builder. |
System.ReadOnlySpan<System.Byte> | macroString | Macro string in UTF-8 to compile and append to <code class="paramref">ssb</code>. |
AppendMacroString(SeStringBuilder, ReadOnlySpan<char>)​
Compiles and appends a macro string.
public static SeStringBuilder AppendMacroString(this SeStringBuilder ssb, ReadOnlySpan<char> macroString)
Returns​
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: this for method chaining.
Parameters​
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Text.SeStringHandling.SeStringBuilder | ssb | Target SeString builder. |
System.ReadOnlySpan<System.Char> | macroString | Macro 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.
public static bool IsValidCharacterName(this SeString value)
Returns​
System.Boolean: indicator if character is name is valid.
Parameters​
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Text.SeStringHandling.SeString | value | character name to validate. |
IsTextOnly(ReadOnlySeString)​
Determines whether the Lumina.Text.ReadOnly.ReadOnlySeString contains only text payloads.
public static bool IsTextOnly(this ReadOnlySeString ross)
Returns​
System.Boolean: true if the string contains only text payloads; otherwise, false.
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.ReadOnly.ReadOnlySeString | ross | The Lumina.Text.ReadOnly.ReadOnlySeString to check. |
IsTextOnly(ReadOnlySeStringSpan)​
Determines whether the Lumina.Text.ReadOnly.ReadOnlySeStringSpan contains only text payloads.
public static bool IsTextOnly(this ReadOnlySeStringSpan rosss)
Returns​
System.Boolean: true if the span contains only text payloads; otherwise, false.
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.ReadOnly.ReadOnlySeStringSpan | rosss | The Lumina.Text.ReadOnly.ReadOnlySeStringSpan to check. |
ContainsText(ReadOnlySeString, ReadOnlySpan<byte>)​
Determines whether the Lumina.Text.ReadOnly.ReadOnlySeString contains the specified text.
public static bool ContainsText(this ReadOnlySeString ross, ReadOnlySpan<byte> needle)
Returns​
System.Boolean: true if the text is found; otherwise, false.
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.ReadOnly.ReadOnlySeString | ross | The Lumina.Text.ReadOnly.ReadOnlySeString to search. |
System.ReadOnlySpan<System.Byte> | needle | The text to find. |
ContainsText(ReadOnlySeStringSpan, ReadOnlySpan<byte>)​
Determines whether the Lumina.Text.ReadOnly.ReadOnlySeStringSpan contains the specified text.
public static bool ContainsText(this ReadOnlySeStringSpan rosss, ReadOnlySpan<byte> needle)
Returns​
System.Boolean: true if the text is found; otherwise, false.
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.ReadOnly.ReadOnlySeStringSpan | rosss | The Lumina.Text.ReadOnly.ReadOnlySeStringSpan to search. |
System.ReadOnlySpan<System.Byte> | needle | The text to find. |
ContainsText(SeStringBuilder, ReadOnlySpan<byte>)​
Determines whether the Lumina.Text.SeStringBuilder contains the specified text.
public static bool ContainsText(this SeStringBuilder builder, ReadOnlySpan<byte> needle)
Returns​
System.Boolean: true if the text is found; otherwise, false.
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.SeStringBuilder | builder | The builder to search. |
System.ReadOnlySpan<System.Byte> | needle | The text to find. |
ReplaceText(ReadOnlySeString, ReadOnlySpan<byte>, ReadOnlySpan<byte>)​
Replaces occurrences of a specified text in a Lumina.Text.ReadOnly.ReadOnlySeString with another text.
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​
| Type | Name | Description |
|---|---|---|
Lumina.Text.ReadOnly.ReadOnlySeString | ross | The original string. |
System.ReadOnlySpan<System.Byte> | toFind | The text to find. |
System.ReadOnlySpan<System.Byte> | replacement | The replacement text. |
ReplaceText(SeStringBuilder, ReadOnlySpan<byte>, ReadOnlySpan<byte>)​
Replaces occurrences of a specified text in an Lumina.Text.SeStringBuilder with another text.
public static void ReplaceText(this SeStringBuilder builder, ReadOnlySpan<byte> toFind, ReadOnlySpan<byte> replacement)
Parameters​
| Type | Name | Description |
|---|---|---|
Lumina.Text.SeStringBuilder | builder | The builder to modify. |
System.ReadOnlySpan<System.Byte> | toFind | The text to find. |
System.ReadOnlySpan<System.Byte> | replacement | The replacement text. |