Version: | 1.0 |
Status: | Stable |
Date: | January 2004 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems (c) 1998-2004. All rights reserved. |
The Strings module provides a variety of string functions that are common to most programming languages and operating systems. This includes support for string conversions, searching, merging and so forth. This module supports strings of an unlimited length, so you do not need to worry about any possible limitations. As a bonus, this means that you can also use the string functions on large text files and documents (so long as you null terminate them).
The most important thing to remember is that some functions will return strings that have had their space allocated with the AllocMemory() function. If this is the case for a function you are using, make sure you call FreeMemory() on the resulting string before your program exits.
Function Index | |
CharCopy | Copies the characters of one string to another. |
FloatToStr | Converts a floating point number to a string. |
IntToStr | Converts an integer to a string. |
StrBuildArray | Builds an array of strings from a sequential string list. |
StrCalculate | Calculates the total of any string containing calculations. |
StrCapitalise | Capitalises a string. |
StrClone | Clones string data. |
StrCopy | Copies the characters of one string to another. |
StrDatatype | Determines the data type of a string. |
StrExpand | Expands the size of a string by inserting spaces. |
StrFormat | Formats a string using printf() style arguments. |
StrFormatDate | Formats the content of a Time object into a date string. |
StrInsert | Inserts a string into a buffer, with optional replace. |
StrLength | Calculates the length of a string. |
StrLineLength | Determines the line-length of a string. |
StrLower | Changes a string so that all alpha characters are in lower-case. |
StrNextLine | Returns a pointer to the next line in a string buffer. |
StrReadColour | Converts a colour string into its equivalent RGB values. |
StrReplace | Replaces all occurances of a keyword or phrase within a given string. |
StrSearch | Searches a string for a particular keyword/phrase. |
StrShrink | Shrinks strings by destroying data. |
StrSort | Used to sort string arrays. |
StrToFloat | Converts strings to floating point numbers. |
StrToInt | Converts a string to an integer. |
StrTranslate | Translates object references that have been declared within strings. |
StrUpper | Changes a string so that all alpha characters are in upper-case. |
UTF8CharacterLength | Returns the number of bytes used to define a single UTF-8 character. |
UTF8CharacterOffset | Retrieves the byte position of a character in a UTF-8 string. |
UTF8Length | Returns the total number of characters in a UTF-8 string. |
UTF8OffsetToCharacter | Converts a byte offset into a character position. |
UTF8PrevLength | Gets the byte length of the previous character at a specific position in a UTF-8 string. |
UTF8ReadValue | Converts UTF-8 characters into 32-bit unicode values. |
UTF8WriteValue | Writes a 32-bit unicode value into a UTF-8 character buffer. |
Function: | FloatToStr() | ||||||
Short: | Converts a floating point number to a string. | ||||||
Synopsis: | LONG FloatToStr(DOUBLE Number, STRING String, LONG Size) | ||||||
Arguments: |
| ||||||
|
Function: | IntToStr() | ||||||
Short: | Converts an integer to a string. | ||||||
Synopsis: | LONG IntToStr(LARGE Integer, STRING String, LONG StringSize) | ||||||
Arguments: |
| ||||||
|
Function: | StrBuildArray() | ||||||||
Short: | Builds an array of strings from a sequential string list. | ||||||||
Synopsis: | STRING * StrBuildArray(STRING List, LONG Size, LONG AmtEntries, LONG Flags) | ||||||||
Arguments: |
| ||||||||
|
Function: | StrCalculate() | |||||||||
Short: | Calculates the total of any string containing calculations. | |||||||||
Synopsis: | ERROR StrCalculate(STRING String, DOUBLE *Result, STRING Buffer, LONG BufferSize) | |||||||||
Arguments: |
| |||||||||
|
Function: | StrCapitalise() | ||
Short: | Capitalises a string. | ||
Synopsis: | void StrCapitalise(STRING String) | ||
Arguments: |
| ||
|
Function: | StrClone() | |||
Short: | Clones string data. | |||
Synopsis: | STRING StrClone(STRING String) | |||
Arguments: |
| |||
|
Function: | StrCopy() | ||||||
Short: | Copies the characters of one string to another. | ||||||
Synopsis: | LONG StrCopy(STRING Source, STRING Destination, LONG Length) | ||||||
Arguments: |
| ||||||
|
Function: | StrDatatype() | |||
Short: | Determines the data type of a string. | |||
Synopsis: | LONG StrDatatype(STRING String) | |||
Arguments: |
| |||
|
Function: | StrExpand() | ||||||
Short: | Expands the size of a string by inserting spaces. | ||||||
Synopsis: | LONG StrExpand(STRING String, LONG Position, LONG TotalChars) | ||||||
Arguments: |
| ||||||
|
Function: | StrFormat() | ||||||||
Short: | Formats a string using printf() style arguments. | ||||||||
Synopsis: | LONG StrFormat(STRING Buffer, LONG BufferSize, STRING Format, Args...); | ||||||||
Arguments: |
| ||||||||
|
Function: | StrFormatDate() | |||||||||||||||||||||||||||||||||||||||||||||||||
Short: | Formats the content of a Time object into a date string. | |||||||||||||||||||||||||||||||||||||||||||||||||
Synopsis: | ERROR StrFormatDate(STRING Buffer, LONG Length, STRING Format, *Time) | |||||||||||||||||||||||||||||||||||||||||||||||||
Arguments: |
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
Function: | StrInsert() | ||||||||||
Short: | Inserts a string into a buffer, with optional replace. | ||||||||||
Synopsis: | ERROR StrInsert(STRING Insert, STRING Buffer, LONG Position, LONG ReplaceChars, LONG BufferSize) | ||||||||||
Arguments: |
| ||||||||||
|
Function: | StrLength() | |||
Short: | Calculates the length of a string. | |||
Synopsis: | LONG StrLength(STRING String) | |||
Arguments: |
| |||
|
Function: | StrLineLength() | |||
Short: | Determines the line-length of a string. | |||
Synopsis: | LONG StrLineLength(STRING String) | |||
Arguments: |
| |||
|
Function: | StrLower() | ||
Short: | Changes a string so that all alpha characters are in lower-case. | ||
Synopsis: | void StrLower(STRING String) | ||
Arguments: |
| ||
|
Function: | StrNextLine() | |||
Short: | Returns a pointer to the next line in a string buffer. | |||
Synopsis: | STRING StrNextLine(STRING Buffer); | |||
Arguments: |
| |||
|
Function: | StrReadColour() | ||||||||||
Short: | Converts a colour string into its equivalent RGB values. | ||||||||||
Synopsis: | ERROR ReadColour(STRING Colour, LONG *Red, LONG *Green, LONG *Blue, LONG *Alpha) | ||||||||||
Arguments: |
| ||||||||||
|
Function: | StrReplace() | |||||||||||
Short: | Replaces all occurances of a keyword or phrase within a given string. | |||||||||||
Synopsis: | ERROR StrReplace(STRING Source, STRING Keyword, STRING Replacement, STRING *Result, LONG CaseSensitive) | |||||||||||
Arguments: |
| |||||||||||
|
Function: | StrSearch() | ||||||
Short: | Searches a string for a particular keyword/phrase. | ||||||
Synopsis: | LONG StrSearch(STRING Keyword, STRING String, LONG CaseSensitive) | ||||||
Arguments: |
| ||||||
|
Function: | StrShrink() | ||||||
Short: | Shrinks strings by destroying data. | ||||||
Synopsis: | void StrShrink(STRING String, LONG Position, LONG TotalBytes) | ||||||
Arguments: |
| ||||||
|
Function: | StrSort() | |||||||
Short: | Used to sort string arrays. | |||||||
Synopsis: | ERROR StrSort(STRING *List, LONG Flags) | |||||||
Arguments: |
| |||||||
|
Function: | StrToFloat() | |||
Short: | Converts strings to floating point numbers. | |||
Synopsis: | DOUBLE StrToFloat(STRING String) | |||
Arguments: |
| |||
|
Function: | StrToInt() | |||
Short: | Converts a string to an integer. | |||
Synopsis: | LARGE StrToInt(STRING String) | |||
Arguments: |
| |||
|
Function: | StrTranslate() | |||||||||||||||||||||||
Short: | Translates object references that have been declared within strings. | |||||||||||||||||||||||
Synopsis: | ERROR StrTranslate(STRING Buffer, LONG Length, LONG Flags) | |||||||||||||||||||||||
Arguments: |
| |||||||||||||||||||||||
|
Function: | StrUpper() | ||
Short: | Changes a string so that all alpha characters are in upper-case. | ||
Synopsis: | void StrUpper(STRING String) | ||
Arguments: |
| ||
|
Function: | UTF8CharacterLength() | |||
Short: | Returns the number of bytes used to define a single UTF-8 character. | |||
Synopsis: | LONG UTF8CharacterLength(STRING String) | |||
Arguments: |
| |||
|
Function: | UTF8CharacterOffset() | ||||
Short: | Retrieves the byte position of a character in a UTF-8 string. | ||||
Synopsis: | LONG UTF8CharacterOffset(STRING String, LONG Position) | ||||
Arguments: |
| ||||
|
Function: | UTF8Length() | |||
Short: | Returns the total number of characters in a UTF-8 string. | |||
Synopsis: | LONG UTF8Length(STRING String) | |||
Arguments: |
| |||
|
Function: | UTF8OffsetToCharacter() | ||||
Short: | Converts a byte offset into a character position. | ||||
Synopsis: | LONG UTF8OffsetToCharacter(STRING String, LONG Position) | ||||
Arguments: |
| ||||
|
Function: | UTF8PrevLength() | ||||
Short: | Gets the byte length of the previous character at a specific position in a UTF-8 string. | ||||
Synopsis: | LONG UTF8PrevLength(STRING String, LONG Index) | ||||
Arguments: |
| ||||
|
Function: | UTF8ReadValue() | ||||
Short: | Converts UTF-8 characters into 32-bit unicode values. | ||||
Synopsis: | LONG UTF8ReadValue(STRING String, LONG *Length) | ||||
Arguments: |
| ||||
|
Function: | UTF8WriteValue() | ||||||
Short: | Writes a 32-bit unicode value into a UTF-8 character buffer. | ||||||
Synopsis: | LONG UTF8WriteValue(LONG Value, STRING String, LONG StringSize) | ||||||
Arguments: |
| ||||||
|