Difference between revisions of "StringUtil Script"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>CraftySentinel
m (→‎SKSE Global Functions: Formatting Change)
imported>CraftySentinel
m (→‎SKSE Global Functions: Reverted to List)
Line 17: Line 17:
== SKSE Global Functions ==
== SKSE Global Functions ==


{|class="wikitable" width =100%
:'''Int [[GetLength - StringUtil|GetLength]](String ''str'')'''
!style="text-align:left;"|Function
:*Returns the length of the string.
!style="text-align:left;"|Description
|-
|[[GetLength - StringUtil|Int '''GetLength'''(String ''str'')]]
|Returns the length of the string.
|-


|[[GetNthChar - StringUtil|String '''GetNthChar'''(String ''str'', Int ''n'')]]
:'''String [[GetNthChar - StringUtil|GetNthChar]](String ''str'', Int ''n'')'''
|Returns the character at n in str as a string.
:*Returns the character at n in str as a string.
|-


|[[IsLetter - StringUtil|Bool '''IsLetter'''(String ''c'')]]
:'''Bool [[IsLetter - StringUtil|IsLetter]](String ''c'')'''
|Returns whether the character is a letter or not.
:*Returns whether the character is a letter or not.
|-


|[[IsDigit - StringUtil|Bool '''IsDigit'''(String ''c'')]]
:'''Bool [[IsDigit - StringUtil|IsDigit]](String ''c'')'''
|Returns whether the character is a digit or not.
:*Returns whether the character is a digit or not.
|-


|[[IsPunctuation - StringUtil|Bool '''IsPunctuation'''(String ''c'')]]
:'''Bool [[IsPunctuation - StringUtil|IsPunctuation]](String ''c'')'''
|Returns whether the character is punctuation or not.
:*Returns whether the character is punctuation or not.
|-


|[[IsPrintable - StringUtil|Bool '''IsPrintable'''(String ''c'')]]
:'''Bool [[IsPrintable - StringUtil|IsPrintable]](String ''c'')'''
|Returns whether the character is printable or not.
:*Returns whether the character is printable or not.
|-


|[[Find - StringUtil|Int '''Find'''(String ''str'', String ''toFind'', Int ''startIndex'')]]
:'''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.
:*Returns the index of the first occurence of specified phrase inside the string, starting at given position.
|-


|[[Substring - StringUtil|String '''Substring'''(String ''str'', Int ''startIndex'', Int ''len'')]]
:'''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.
:*Returns a portion of the string starting at given index with specified amount of characters.
|-


|[[AsOrd - StringUtil|Int '''AsOrd'''(String ''c'')]]
:'''Int [[AsOrd - StringUtil|AsOrd]](String ''c'')'''
|Returns the numeric value of a character.
:*Returns the numeric value of a character.
|-


|[[AsChar - StringUtil|String '''AsChar'''(Int ''c'')]]
:'''String [[AsChar - StringUtil|AsChar]](Int ''c'')'''
|Returns the number as a string character.
:*Returns the number as a string character.
|-
 
|}


== Member Functions ==
== Member Functions ==

Revision as of 22:17, 2 February 2014


Collection of generic string utility global functions. (These global functions require SKSE)

Definition

ScriptName StringUtil

Properties

None

SKSE Global Functions

Int GetLength(String str)
  • Returns the length of the string.
String GetNthChar(String str, Int n)
  • Returns the character at n in str as a string.
Bool IsLetter(String c)
  • Returns whether the character is a letter or not.
Bool IsDigit(String c)
  • Returns whether the character is a digit or not.
Bool IsPunctuation(String c)
  • Returns whether the character is punctuation or not.
Bool IsPrintable(String c)
  • Returns whether the character is printable or not.
Int 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(String str, Int startIndex, Int len)
  • Returns a portion of the string starting at given index with specified amount of characters.
Int AsOrd(String c)
  • Returns the numeric value of a character.
String AsChar(Int c)
  • Returns the number as a string character.

Member Functions

None

Events

None