Utilities
Functions
Base64 Decode
Converts the provided Base64 encoded string back to its original form. For example, “TWFu” will be converted to “Man”.
Parameters:
Name | Type | Description |
---|---|---|
input | String | Base64 encoded string to decode |
Return Type: String
Signatures:
Base64 Encode
Converts the provided string into its Base64 encoded representation. For example, “Man” will be converted to “TWFu”.
Parameters:
Name | Type | Description |
---|---|---|
input | String | String to encode |
Return Type: String
Signatures:
Bin To Dec
Converts the provided binary string into an unsigned integer. For example, “1010” will be converted to 10.
Parameters:
Name | Type | Description |
---|---|---|
bin | String | Binary string to convert |
Return Type: Unsigned Integer
Signatures:
Bin To Hex
Converts the provided binary string into a hexadecimal string representation. For example, “1010” will be converted to “A”.
Parameters:
Name | Type | Description |
---|---|---|
bin_str | String | Binary string to convert |
Return Type: String
Signatures:
Bin To Oct
Converts the provided binary string into its octal string representation. For example, “1010” will be converted to “12”.
Parameters:
Name | Type | Description |
---|---|---|
bin_str | String | Binary string to convert |
Return Type: String
Signatures:
Calculate Square Root
Calculates the square root of the provided number using the Newton-Raphson method.
Parameters:
Name | Type | Description |
---|---|---|
number | Integer | Number to calculate the square root of |
Return Type: Double
Signatures:
Contains
Returns true if the string contains the substring.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to search |
subtext | String | The substring to search for |
Return Type: Boolean
Signatures:
Convert To Double
Convert the passed in string into a double. This can fail in an error if the value is not a number, consider using Is Number
to check before converting a string.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to convert. |
Return Type: Double
Usage:
Signatures:
Convert To Integer
Convert the passed in string into an integer. This can fail in an error if the value is not an integer, consider using Is Integer
to check before converting a string.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to convert. |
Return Type: Integer
Usage:
Signatures:
Dec To Bin
Converts the provided unsigned integer into a binary string. For example, 10 will be converted to “1010”.
Parameters:
Name | Type | Description |
---|---|---|
dec | unsigned int | Decimal (unsigned integer) to convert |
Return Type: String
Signatures:
Dec To Oct
Converts the provided decimal value into its octal string representation. For example, 64 will be converted to “100”.
Parameters:
Name | Type | Description |
---|---|---|
decimal_value | unsigned int | Decimal (unsigned integer) to convert |
Return Type: String
Signatures:
Greatest Common Divisor
The greatest common divisor (GCD) of two numbers is the largest positive integer that divides both numbers without a remainder.
Parameters:
Name | Type | Description |
---|---|---|
number1 | Integer | First number |
number2 | Integer | Second number |
Return Type: Integer
Signatures:
Hex To Bin
Converts the provided hexadecimal string into its binary string representation. For example, “A” will be converted to “1010”.
Parameters:
Name | Type | Description |
---|---|---|
hex_str | String | Hexadecimal string to convert |
Return Type: String
Signatures:
Hex To Oct
Converts the provided hexadecimal string into its octal string representation. For example, “A” will be converted to “12”.
Parameters:
Name | Type | Description |
---|---|---|
hex_str | String | Hexadecimal string to convert |
Return Type: String
Signatures:
Index Of
Returns the index of the first occurrence of the substring in the text.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to search |
subtext | String | The substring to search for |
Return Type: Integer
Signatures:
Is Binary
A binary string is a string that contains only ‘0’ and ‘1’ characters.
Parameters:
Name | Type | Description |
---|---|---|
bin_str | String | Binary string to check |
Return Type: Boolean
Signatures:
Is Double
Checks if a string contains a number.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to check. |
Return Type: Boolean
Signatures:
Is Hex
A hexadecimal string is a string that contains only characters from ‘0’ to ‘9’ and ‘A’ to ‘F’ (or ‘a’ to ‘f’).
Parameters:
Name | Type | Description |
---|---|---|
hex_str | String | Hexadecimal string to check |
Return Type: Boolean
Signatures:
Is Integer
Checks if a string contains an integer value.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to check. |
Return Type: Boolean
Usage:
Signatures:
Is Number
Checks if a string contains a number.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to check. |
Return Type: Boolean
Usage:
Signatures:
Is Octal
An octal string is a string that contains only characters from ‘0’ to ‘7’.
Parameters:
Name | Type | Description |
---|---|---|
octal_str | String | Octal string to check |
Return Type: Boolean
Signatures:
Is Prime Number
A prime number is a number greater than 1 that has no positive divisors other than 1 and itself.
Parameters:
Name | Type | Description |
---|---|---|
number | Integer | Number to check |
Return Type: Boolean
Signatures:
Least Common Multiple
The least common multiple (LCM) of two numbers is the smallest positive integer that is divisible by both numbers.
Parameters:
Name | Type | Description |
---|---|---|
number1 | Integer | First number |
number2 | Integer | Second number |
Return Type: Integer
Signatures:
Length Of
Returns the length of a string in characters.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to get the length of |
Return Type: Integer
Usage:
See Example Code
Signatures:
Oct To Bin
Converts the provided octal string into its binary string representation. For example, “12” will be converted to “1010”.
Parameters:
Name | Type | Description |
---|---|---|
octal_str | String | Octal string to convert |
Return Type: String
Signatures:
Oct To Dec
Converts the provided octal string into its decimal representation. For example, “100” will be converted to 64.
Parameters:
Name | Type | Description |
---|---|---|
octal_string | String | Octal string to convert |
Return Type: Unsigned Integer
Signatures:
Oct To Hex
Converts the provided octal string into its hexadecimal string representation. For example, “12” will be converted to “A”.
Parameters:
Name | Type | Description |
---|---|---|
oct_str | String | Octal string to convert |
Return Type: String
Signatures:
Replace All
Replace all occurrences of a substring in a string with another string.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to search |
substr | String | The substring to find and replace |
newText | String | The string to replace the substring with |
Return Type: String
Signatures:
Split
Split a string into an array of strings based on a delimiter.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to split |
delimiter | Char | The character to split the text on |
Return Type: Vector
Signatures:
To Lowercase
Return a lowercase version of the passed in string.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to convert. |
Return Type: String
Usage:
Signatures:
To Uppercase
Return a UPPERCASE version of the passed in string.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to convert. |
Return Type: String
Usage:
Signatures:
Trim
Return a new string that removes the spaces from the start and end of the input string.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The string to trim. |
Return Type: String
Usage:
Signatures:
Rnd
Rnd
Generates a random number between ‘min’ and max
, including ‘min’ and ‘max’.
Parameters:
Name | Type | Description |
---|---|---|
min | Integer | the Integer representing of minimum bound. |
max | Integer | the Integer representing of maximum bound. |
Return Type: Integer
Signatures:
Rnd
Generates a random number between 0 and 1
Return Type: Float
Signatures:
Rnd
Generates a random number between 0 and ubound
.
Parameters:
Name | Type | Description |
---|---|---|
ubound | Integer | the Integer representing the upper bound. |
Return Type: Integer
Signatures:
Current Ticks
Gets the number of milliseconds that have passed since the program was started.
Return Type: Unsigned Integer
Signatures:
Delay
Puts the program to sleep for a specified number of milliseconds. If this is larger than 1 second, SplashKit will check to see if the user tries to quit during the delay. If the user does quit, the delay function returns without waiting.
Parameters:
Name | Type | Description |
---|---|---|
milliseconds | Integer | The number of milliseconds to wait |
Usage:
Signatures:
Display Dialog
Display a dialog to the screen with a message for the user.
Parameters:
Name | Type | Description |
---|---|---|
title | String | The title of the dialog window. |
msg | String | The message for the dialog window. |
output_font | Font | The font for the dialog text |
font_size | Integer | The size of the font for the dialog text |
Signatures:
File As String
Return a SplashKit resource of Resource Kind
with name filename
as a string.
Parameters:
Name | Type | Description |
---|---|---|
filename | String | The filename of the resource. |
kind | Resource Kind | The kind of resource. |
Return Type: String
Signatures: