String Operations

The following functions manipulate and manage string data:

ACODE$

Translate a Unicode string into an ANSI string.

ARRAY ASSIGN

Assign a number of values to successive elements of an array.

ARRAY DELETE

Delete a single item from a given array.

ARRAY INSERT

Insert a single item into a given array.

ARRAY SCAN

Scan all or part of an array for a given value.

ARRAY SORT

Sort all or part of a given array.

BIN$

Return a string with the binary (base 2) representation of a value.

BITS$

Copies string contents without modification.

BUILD$

Concatenate multiple strings with high efficiency.

CHOOSE$

Return one of several values, based upon the value of an index.

CHR$

Convert one or more character codes into ASCII character(s).

CHR$$

Convert one or more character codes into Unicode character(s).

CHRBYTES

Determine the size of a single character in a string variable.

ChrToOem$

Translates a string of ANSI/WIDE characters to OEM byte characters.

ChrToUtf8$

Translates a string of ANSI/WIDE characters to UTF-8 byte characters.

CLIP$

Deletes characters from a string.

CLSID$

Return a 16-byte (128-bit) GUID string containing a CLSID.

COMM LINE

Receive a CR/LF terminated "line" of data from a serial port.

COMM PRINT

Send a "line" of binary data through a serial port.

COMM RECV

Receive binary data from a serial port.

COMM SEND

Send a string of binary data through a serial port.

COMMAND$

Return the command-line used to start the program.

CSET

Center a string within the space of another string or UDT.

CSET$

Return a string containing a centered (padded) string.

CURDIR$

Return the current directory for a given drive.

DATA

Declare an array of constants to be read by READ$.

DATACOUNT

Return the total count of the number of local data items.

DATE$

Set and retrieve the system date.

DEC$

Convert an integral value to a decimal string.

DIM

Declare and dimension arrays, scalar variables, and pointers.

DIR$

Return a filename that matches the given mask.

DIR$ CLOSE

Force the release the operating system FindNext handle.

ENVIRON             

Modify the current program's environment table..

ENVIRON$

Retrieve strings from the operating system's environment table.

ERASE

Deallocate array memory.

ERL$

Return the last label, line number, or procedure name executed prior to the most recent error.

ERROR$

Return a string containing the descriptive name of an error.

EXTRACT$

Return up to the first occurrence of a specified character.

EXE

Return the path and/or name of the executing program.

FIELD

Bind a field string variable to a particular sub-section of a random file buffer or a dynamic string variable.

FIELD RESET

Reset the FIELD string to a nul (zero-length) dynamic string.

FIELD STRING

Change the FIELD string to a dynamic string, but first assigns the current sub-section data to it.

FILENAME$

Return the file-system name of an open file.

FORMAT$

Return a string containing formatted numeric data.

FUNCNAME$

Return the name of the current Sub/Function/Method/Property.

GET

Read a record from a random-access file.

GET$

Read a string from a file opened in binary mode.

GET$$

Reads WIDE string data from a file opened in binary mode.

GRAPHIC SPLIT

Splits a string into two parts for display on a graphic target.

GUID$

Return a 16-byte (128-bit) Globally Unique Identifier GUID.

GUIDTXT$

Return a 38-byte human-readable GUID/UUID string.

HEX$

Hexadecimal (base 16) string representation of an argument.

IIF$

Return one of two values based upon a True/False evaluation.

INPUT#

Load variables with data from a sequential file.

INPUTBOX$

INPUTBOX$ displays a dialog box containing a prompt.

INSTR

Search a string for the first occurrence of a character or string.

ISNOTNULL

Determine if a string is not nul (contains 1 or more characters).

ISNULL

Determine if a string is nul (zero-length).

IStringBuilderA.Add

Appends an ANSI string to the object.

IStringBuilderA.Capacity <Get>

Retrieves the size of the internal buffer.

IStringBuilderA.Capacity <Set>

Sets the size of the internal buffer.

IStringBuilderA.Char <Get>

Returns the numeric character code of the character at the specified position.

IStringBuilderA.Char <Set>

Changes the numeric character code of the character at the specified position.

IStringBuilderA.Clear

All data in the object is erased.

IStringBuilderA.Delete

Deletes a specified number of characters starting at a specified position.

IStringBuilderA.Insert

Inserts a string at a specified position.

IStringBuilderA.Len

Returns the number of characters stored in the object.

IStringBuilderA.String

The ANSI string stored in the object is returned to the caller.

IStringBuilderW.Add

Appends an WIDE string to the object.

IStringBuilderW.Capacity <Get>

Retrieves the size of the internal buffer.

IStringBuilderW.Capacity <Set>

Sets the size of the internal buffer.

IStringBuilderW.Char <Get>

Returns the numeric character code of the character at the specified position.

IStringBuilderW.Char <Set>

Changes the numeric character code of the character at the specified position.

IStringBuilderW.Clear

All data in the object is erased.

IStringBuilderW.Delete

Deletes a specified number of characters starting at a specified position.

IStringBuilderW.Insert

Inserts a string at a specified position.

IStringBuilderW.Len

Returns the number of characters stored in the object.

IStringBuilderW.String

The WIDE string stored in the object is returned to the caller.

JOIN$

Return a string consisting of all of the strings in a string array.

LCASE$

Return a lowercase version of a string argument.

LEFT$

Return the left-most n characters of a string.

LEN

Return the logical length of a variable, UDT, or Union.

LET

Assign a value to a variable.

LET (with Types)

Assign data to a user-defined type variable.

LET (with Variants)

Assign a value or an object reference to a variant variable.

LINE INPUT#

Read line(s) from a sequential file into a string variable or array.

LPRINT 

Output text and data to a printer device.

LPRINT$               

Return the current printer device used for LPRINT operations.

LSET

Left-align a string within the space of another string or UDT.

LSET$

Return a string containing a left-justified (padded) string.

LTRIM$

Return a string with leading characters or strings removed.

MAX$

Return the argument with the largest (maximum) value.

MCASE$

Return a mixed case version of a string argument.

MID$

Return a portion of a string.

MID$

Replace characters in a string with characters from another string.

MIN$

Return the argument with the smallest (minimum) value.

MKBYT$

Convert a Byte value into a binary encoded string.

MKCUR$

Convert a Currency value into a binary encoded string.

MKCUX$

Convert an Extended Currency value into a binary encoded string.

MKD$

Convert a Double-precision value into a binary encoded string.

MKDWD$

Convert a Double-word value into a binary encoded string.

MKE$

Convert an Extended-precision value into a binary encoded string.

MKI$

Convert a integral value into a binary encoded string.

MKL$

Convert a Long-integer value into a binary encoded string.

MKQ$

Convert a Quad-integer value into a binary encoded string.

MKS$

Convert a Single-precision value into a binary encoded string.

MKWRD$

Convert a Word value into a binary encoded string.

MKDIR

Create a subdirectory/folder (like the DOS MKDIR command).

NUL$     

Return a string containing a specified number of $NUL characters.

OBJRESULT$

Returns a string which describes an OBJRESULT (hResult) code.

OCT$

Return a string that is a octal (base 8) representation of a value.

OemToChr$

Translates a byte string of OEM characters into ANSI/WIDE characters.

PARSE

Parse a string and extract all delimited fields into an array.

PARSE$

Return a delimited field from a string expression.

PARSECOUNT

Return the count of delimited fields in a string expression.

PATHNAME$

Parse a path/file name to extract component parts.

PATHSCAN$

Find a file on disk and return the path and/or file name parts..

PEEK$

Returns consecutive 1-byte characters starting at a specific memory location.

PEEK$$

Returns consecutive 2-byte wide characters starting at a specific memory location.

POKE$

Store a sequence of bytes starting at a specific memory location.

POKE$$

Store a sequence as 2-byte wide characters starting at a specific memory location.

PRINT#

Write a complete array to a sequential file.

PROGID$

Return the alphanumeric PROGID string (text) of a given CLSID.

PUT

Write a record to a random-access file or variable to a binary file.

PUT$

Writes an ANSI string to a file opened in binary mode.

PUT$$

Writes a WIDE Unicode string to a file opened in binary mode.

READ$

Retrieve string data from a local DATA list.

REGEXPR

Scan a string for a matching "wildcard" or regular expression.

REGREPL

Scan a "wildcard" match in a string with a new string.

REMAIN$

Returns the portion of a string which follows the first occurrence of a character or group of characters.

REMOVE$

Return a copy of a string with characters or strings removed.

REPEAT$

Return a string consisting of multiple copies of a specified string.

REPLACE

Replace all occurrences of one string with another string.

RESET

Clear a string, string array subscript, or an entire array.

RESOURCE$

Returns predefined resource data.

RETAIN$

Return a string with all non-specified characters removed.

RIGHT$

Return the rightmost n characters of a string.

RSET

Right justify a string into the space of a string variable or UDT.

RSET$

Return a string containing a right-justified (padded) string.

RTRIM$

Return a copy of a string with trailing characters/strings removed.

SHRINK$

Shrinks a string to use a consistent single character delimiter.

SIZEOF

Return the total or physical length of any PowerBASIC variable.

SPACE$

Return a string consisting of a specified number of spaces.

SPLIT

Splits a string into two parts.

STR$

Return the string representation of a number in printable form.

STRDELETE$

Delete a specified number of characters from a string expression.

STRING$

Returns an ANSI string consisting of multiple copies of a specified character.

STRING$$

Returns a WIDE string consisting of multiple copies of a specified character.

STRINSERT$

Insert a string at a specified position within another string.

STRPTR

Return the address of the data held by a variable length string.

STRREVERSE$

Reverse the contents of a string expression.

SWAP

Exchange the values of two strings, pointers, or pointer targets.

SWITCH$

Return one item of a series based upon a True/False evaluation.

TAB$

Return a string with TAB characters expanded with spaces.

TALLY

Count the number of occurrences of specified characters/strings.

TIME$

Read and/or set the system time.

TRIM$

Return a string with leading and trailing characters removed.

TYPE SET

Assign the value of a UDT or string expression to a UDT.

UCASE$

Return an all-uppercase (capitalized) version of a string.

UCODE$

Translate an ANSI string into a Unicode string.

UCODEPAGE

Set the default codepage used for ANSI / UNICODE conversions.

UNWRAP$

Removes paired characters from the beginning and end of a string.

USING$

Format string/numeric expressions using a mask string.

Utf8ToChr$

Translates a byte string of OEM characters into ANSI/WIDE characters.

VAL function

Returns the numeric equivalent of a string argument.

VAL statement

Converts a text string to a numeric value with additional information.

VARIANT$

Returns the ANSI dynamic string contained in a Variant variable.

VARIANT$$

Returns the Unicode dynamic string contained in a Variant variable.

VARPTR

Return the 32-bit address of a string handle.

VERIFY

Determine if each character of a string is in another string.

WRAP$

Adds paired characters to the beginning and end of a string.