Editing
StringUtil Script
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
[[Category:Scripting]] [[Category:Papyrus]] [[Category:Script Objects]] [[Category:SKSE]] [[Category:SKSE Script Objects]] Collection of generic string utility global functions. (These global functions require SKSE) A comment found at the top of this script, still present as of SKSE64 version 2.2.6, reads: <blockquote> 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" depending on which might be registered first. All my tests so far have it return the uppercase, even though 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. </blockquote> == Definition == <syntaxhighlight lang="papyrus"> ScriptName StringUtil </syntaxhighlight> == Properties == None == SKSE Global Functions == :'''Int [[GetLength - StringUtil|GetLength]](String ''str'')''' :*Returns the length of the string. :'''String [[GetNthChar - StringUtil|GetNthChar]](String ''str'', Int ''n'')''' :*Returns the character at n in str as a string. :'''Bool [[IsLetter - StringUtil|IsLetter]](String ''c'')''' :*Returns whether the character is a letter or not. :'''Bool [[IsDigit - StringUtil|IsDigit]](String ''c'')''' :*Returns whether the character is a digit or not. :'''Bool [[IsPunctuation - StringUtil|IsPunctuation]](String ''c'')''' :*Returns whether the character is punctuation or not. :'''Bool [[IsPrintable - StringUtil|IsPrintable]](String ''c'')''' :*Returns whether the character is printable or not. :'''Int [[Find - StringUtil|Find]](String ''str'', String ''toFind'', Int ''startIndex'')''' :*Returns the index of the first occurence of specified phrase inside the string, starting at given position. :'''String [[Substring - StringUtil|Substring]](String ''str'', Int ''startIndex'', Int ''len'')''' :*Returns a portion of the string starting at given index with specified amount of characters. :'''Int [[AsOrd - StringUtil|AsOrd]](String ''c'')''' :*Returns the decimal value of a character. :'''String [[AsChar - StringUtil|AsChar]](Int ''c'')''' :*Returns the decimal as a string character. :'''String[] [[Split - StringUtil|Split]](String ''s'', String ''delim'')''' :*Returns array of strings separated by the specified delimiter. == Member Functions == None == Events == None
Summary:
Please note that all contributions to the CreationKit Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
CreationKit:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
Edit source
View history
More
Search
Navigation
Landing page
Tutorials
Game Systems
Editor Reference
Scripting Reference
Recent changes
Help
Tools
What links here
Related changes
Special pages
Page information
Page values