Skip to content

Category String Functions

Paul Squires edited this page Oct 19, 2026 · 2 revisions

Home › All Categories › String Functions

String Functions

Grouped by task. Text lists them beside the rest of the area.

Find text in a string

Function What it does From
InStr Returns the position of the first match, or 0 if there is none. built-in
InStrRev Returns the position of the last match, or 0 if there is none. built-in

Check what a string holds

Function What it does From
Len Returns the length of a string, or the size of a type. built-in

Take part of a string

Function What it does From
Left Returns the first n characters. built-in
Right Returns the last n characters. built-in
Mid Returns the characters from a position, optionally for a given length. built-in

Change case

Function What it does From
UCase Returns an upper-case copy of the string. built-in
LCase Returns a lower-case copy of the string. built-in

Trim, pad and align

Function What it does From
Trim Removes spaces, or the given characters, from both ends. built-in
LTrim Removes spaces, or the given characters, from the start. built-in
RTrim Removes spaces, or the given characters, from the end. built-in
LSet Copies a string into another, left-justified and padded with spaces. built-in
RSet Copies a string into another, right-justified and padded with spaces. built-in

Replace, insert and remove

Function What it does From
Mid (statement) Overwrites part of a string in place with other text. built-in

Build and wrap strings

Function What it does From
Space Returns a string of n spaces. built-in
WSpace Returns a wide string of n spaces. built-in
String Returns a string of n copies of one character. built-in
WString Returns a wide string of n copies of one character. built-in

Characters and their codes

Function What it does From
Asc Returns the character code at a position in a string. built-in
Chr Returns a string made from one or more character codes. built-in
WChr Returns a wide string made from one or more Unicode code points. built-in

Convert numbers to text

Function What it does From
Format Formats a number with a picture string such as "#,##0.00". string.bi
Hex Returns a number as hexadecimal text. built-in
WHex Returns a number as hexadecimal wide-string text. built-in
Bin Returns a number as binary text. built-in
WBin Returns a number as binary wide-string text. built-in
Oct Returns a number as octal text. built-in
WOct Returns a number as octal wide-string text. built-in

Pack numbers into bytes and back

Function What it does From
MKI Copies an integer's bytes into a string. built-in
MKL Copies a Long's bytes into a 4-byte string. built-in
MKShort Copies a Short's bytes into a 2-byte string. built-in
MKLongInt Copies a LongInt's bytes into an 8-byte string. built-in
MKS Copies a Single's bytes into a 4-byte string. built-in
MKD Copies a Double's bytes into an 8-byte string. built-in
CVI Reads an integer back from a string of its bytes. built-in
CVL Reads a Long back from a 4-byte string. built-in
CVShort Reads a Short back from a 2-byte string. built-in
CVLongInt Reads a LongInt back from an 8-byte string. built-in
CVS Reads a Single back from a 4-byte string. built-in
CVD Reads a Double back from an 8-byte string. built-in

Also in this category


Home · Keyword Index

Clone this wiki locally