Class StringUtilScript
- Namespace
- SkyrimForge.Papyrus
- Assembly
- SkyrimForge.Game.dll
Functions and comments from StringUtil.psc.
Note about the internal Skyrim implementation of the string classes used for scripting: the strings are case-insensitive. Each BSFixedString is managed in a cache and reused everywhere it is needed. This means that strings like "O" and "o" are technically equivalent; Which string is used depends greatly on which version is found first. We are investigating how to manage this, but for the time being be aware that the distinction between uppercase and lowercase may not exist. It also means that functions below returning an integer for the character may not correspond exactly. Also GetNthChar("Hello Skyrim!", 4) will return a string with either "O" or "o" depnding on which might be registered first. All my tests so far have it return the uppercase, eventhough in the string it is lowercase. We may solve this problem by switching back to returning an integer rather than a string for GetNthChar, but this will still have problems.
public static class StringUtilScript
- Inheritance
-
StringUtilScript
- Inherited Members
Properties
Dispatcher
The dispatcher that binds this script to a form and calls the functions and properties that have no generated member.
public static PapyrusScriptDispatcher Dispatcher { get; }
Property Value
Methods
AsChar(int)
returns a single character string interpreting c as a character
public static Task<string> AsChar(int c)
Parameters
cint
Returns
AsOrd(string)
returns the numeric value of the first character as an int
public static Task<int> AsOrd(string c)
Parameters
cstring
Returns
Find(string, string, int)
returns the index of the first character of toFind inside string s returns -1 if toFind is not part of the string or if startIndex is invalid
public static Task<int> Find(string s, string toFind, int startIndex = 0)
Parameters
Returns
GetLength(string)
return the length of the string
public static Task<int> GetLength(string s)
Parameters
sstring
Returns
GetNthChar(string, int)
returns a single character string with the character at index
public static Task<string> GetNthChar(string s, int index)
Parameters
Returns
IsDigit(string)
public static Task<bool> IsDigit(string c)
Parameters
cstring
Returns
IsLetter(string)
public static Task<bool> IsLetter(string c)
Parameters
cstring
Returns
IsPrintable(string)
public static Task<bool> IsPrintable(string c)
Parameters
cstring
Returns
IsPunctuation(string)
public static Task<bool> IsPunctuation(string c)
Parameters
cstring
Returns
Split(string, string)
returns array of strings separated by the specified delimiter
public static Task<string[]> Split(string s, string delim)
Parameters
Returns
Substring(string, int, int)
returns a substring of the specified string starting at startIndex and going for len characters or until the end of the string. Default len of 0 means for the entire string
public static Task<string> Substring(string s, int startIndex, int len = 0)