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

CHOOSE$

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

CHR$

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

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

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

ERROR$

Return a string containing the descriptive name of an error

EXTRACT$

Return up to the first occurrence of a specified character

FIELD

Bind a field string to a file buffer or dynamic string variable

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

GET

Read a record from a random-access file

GET$

Read a string from a file opened in binary mode

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

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 string or string array to a Variant

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 (minimium) 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 Integer 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

OCT$

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

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

PEEK$

Return a sequence of bytes starting at a specific memory location

POKE$

Store a sequence of bytes 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$

Write a 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$

Return all characters beyond occurrence of a specified character

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

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

SIZEOF

Return the total or physical length of any PowerBASIC variable

SPACE$

Return a string consisting of a specified number of spaces

STR$

Return the string representation of a number in printable form

STRDELETE$

Delete a specified number of characters from a string expression

STRING$

Return a string with multiple copies of the 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

USING$

Format string/numeric expressions using a mask string

VAL

Return the numeric equivalent of a string argument

VARIANT$

Return the 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