uCalc API Version: 2.1.3-preview.2 Released: 6/17/2026
Warning
uCalc API Preview Release Notice:The documentation describes the intended behavior of the API. The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.
Strings
Product:
Class:
Remarks
🧵 Basic String Operations
| Function | Description |
|---|---|
Repeat(string, size_t) As String | Returns a new string consisting of the first argument repeated y times. |
Append(string, string) | Appends the second string to the first (mutating). |
Append_Copy(string, string) As String | Returns a new string equal to x + y without modifying the original. |
Insert(string, size_t, string) | Inserts substring z into x at index y (mutating). |
Insert_Copy(string, size_t, string) As String | Returns a new string with z inserted at index y. |
Erase(string, size_t = 0, size_t = 0) | Removes a substring from x starting at y of length z (mutating). |
Erase_Copy(string, size_t = 0, size_t = 0) As String | Returns a new string with the specified range removed. |
Fill(size_t, uint8_t) As String | Creates a string of length x filled with byte y. |
Replace(string, size_t, size_t, string) | Replaces a substring in a starting at b of length c with d (mutating). |
Replace_Copy(string, size_t, size_t, string) As String | Returns a new string with the replacement applied. |
Substr(string, size_t = 0, size_t = 0) As String | Returns a substring starting at y of length z. |
Length(string) As Size_t | Returns the number of characters in the string. |
C_Str(string) As Int8u Ptr | Returns a pointer to the underlying C‑style character buffer. |
Str(anytype) As String | Converts any type to a string. |
🔤 Case & Trimming
| Function | Description |
|---|---|
LCase(string) As String | Converts all characters to lowercase. |
UCase(string) As String | Converts all characters to uppercase. |
LTrim(string, string = "") As String | Removes leading whitespace or specified characters. |
RTrim(string, string = "") As String | Removes trailing whitespace or specified characters. |
Trim(string, string = "") As String | Removes leading and trailing whitespace or specified characters. |
🔢 Numeric Conversions
| Function | Description |
|---|---|
Bin(int) As String | Converts an integer to a binary string. |
Oct(int) As String | Converts an integer to an octal string. |
Hex(int) As String | Converts an integer to a hexadecimal string. |
📁 File Utilities
| Function | Description |
|---|---|
File(string) As String | Reads the entire contents of a file into a string. |
FileSize(string) As Size_t | Returns the size of a file in bytes. |
🔣 Character Functions
| Function | Description |
|---|---|
Chr(size_t) As String | Converts a numeric code point to a single‑character string. |
Asc(string) As Size_t | Returns the code point of the first character. |
Asc(string, size_t) As Size_t | Returns the code point at position Pos (1‑based). Equivalent to Asc(Substr(s, Pos - 1, 1)). |
🧮 Comparisons & Aggregates
| Function | Description |
|---|---|
Min(string ...) As String | Returns the lexicographically smallest string. |
Max(string ...) As String | Returns the lexicographically largest string. |
Compare(string, string) As Size_t | Compares two strings lexicographically (typically returns <0, 0, or >0). |
🔍 Search & Predicates
| Function | Description |
|---|---|
Contains(string, string, size_t = 0) As Bool | Returns true if the substring exists in txt starting at offset z. |
StartsWith(string, string) As Bool | Returns true if the string begins with the given prefix. |
EndsWith(string, string) As Bool | Returns true if the string ends with the given suffix. |
IndexOf(string, string, size_t = 0) As Size_t | Finds the first occurrence of y in x starting at z. |
LastIndexOf(string, string, size_t = 0) As Size_t | Finds the last occurrence of y in x starting backward from z. |
Find_First_Of(string, string, size_t = 0) As Size_t | Finds the first character in x that matches any in y. |
Find_Last_Of(string, string, size_t = 0) As Size_t | Finds the last character in x that matches any in y. |
Find_First_Not_Of(string, string, size_t = 0) As Size_t | Finds the first character in x not in y. |
Find_Last_Not_Of(string, string, size_t = 0) As Size_t | Finds the last character in x not in y. |
📏 Padding & Formatting
| Function | Description |
|---|---|
PadLeft(string, size_t, string) As String | Pads the string on the left to reach the specified width. |
PadRight(string, size_t, string) As String | Pads the string on the right (you listed PadLeft twice; I assume one is PadRight). |
Format(string, string) As String | Formats a string using a format specifier. |
Format(string, int) As String | Formats an integer using a format specifier. |
Format(string, double) As String | Formats a floating‑point value using a format specifier. |
Format functions are based on C++ standard library std::format. A number of others are also based on C++ string functions. Others are somewhat similar to C# functions.