Component: Advanced String Functions (Utility)

From Flowcode Help
Revision as of 12:03, 14 April 2023 by Wiki bot (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Author Matrix TSL
Version 1.0
Category Utility


Advanced String Functions component

A component designed to add more advanced functions to the existing built-in string library.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_AdvancedStringFunctions.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_AdvancedStringFunctions.fcfx

Detailed description

Explode

The explode functions use a delimiter to split a string up into an array.

For example "1,2,3,4" using the delimiter ',' would create {1,2,3,4}.

Implode

The implode functions do the reverse and create a string from an array.

for example {1,2,3,4} using the delimiter ',' would create "1,2,3,4".


All of the string functions assume that your string variable is large enough to store the data being passed into it. Overflowing the bounds of the string could lead to RAM corruption which could effect the operation of your program.

Examples

No additional examples






Macro reference

Contains

Error creating thumbnail: Unable to save thumbnail to destination
Contains
Scans a string to see if it contains a specific substring. Returns 1 if found, otherwise returns 0. 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StrData
Data string to scan 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StrMatch
String to look for in the data 
Error creating thumbnail: Unable to save thumbnail to destination
- BOOL
Return


ExplodeToByteArray

Error creating thumbnail: Unable to save thumbnail to destination
ExplodeToByteArray
Takes an ASCII string and using a delimiter converts it into an array of bytes. Returns the number of values discovered and placed into the DataArray, e.g. "1,2,3,4" would become {1,2,3,4} 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StringInput
Data string e.g. "1,2,3,4" 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiting character byte for example ',' 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
DataArray
Data array to hold the numberic values found 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
MaxCount
Maximum number of values to return 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Return


ExplodeToFloatArray

Error creating thumbnail: Unable to save thumbnail to destination
ExplodeToFloatArray
Takes an ASCII string and using a delimiter converts it into an array of floats Returns the number of values discovered and placed into the DataArray, e.g. "1.1,2.2,3.3,4.4" would become {1.1,2.2,3.3,4.4} 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StringInput
Data string e.g. "1,2,3,4" 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiting character byte for example ',' 
Error creating thumbnail: Unable to save thumbnail to destination
- FLOAT
DataArray
Data array to hold the numberic values found 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
MaxCount
Maximum number of values to return 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Return


ExplodeToINTArray

Error creating thumbnail: Unable to save thumbnail to destination
ExplodeToINTArray
Takes an ASCII string and using a delimiter converts it into an array of integers. Returns the number of values discovered and placed into the DataArray, e.g. "1,2,3,4" would become {1,2,3,4} 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StringInput
Data string e.g. "1,2,3,4" 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiting character byte for example ',' 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
DataArray
Data array to hold the numberic values found 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
MaxCount
Maximum number of values to return 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Return


ExplodeToStringArray

Error creating thumbnail: Unable to save thumbnail to destination
ExplodeToStringArray
Takes an ASCII string and using a delimiter converts it into an array of strings. Returns the number of values discovered and placed into the DataArray, e.g. "1,2,3,4" would become {"1","2","3","4"} 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StringInput
Data string e.g. "1,2,3,4" 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiting character byte for example ',' 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
DataArray
Data array to hold the numberic values found 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
MaxCount
Maximum number of values to return 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Return


FormattedStringFloat

Error creating thumbnail: Unable to save thumbnail to destination
FormattedStringFloat
Converts a floating point value to a string of a fixed size. The value 5 with a length of 3 and a character of '0' would generate "003"  
Error creating thumbnail: Unable to save thumbnail to destination
- FLOAT
Value
value to format 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
MinLength
The minimum length you want the string to be 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
PaddChar
Added character to padd the string with e.g. ' ' or '0' 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Precision
Number of decimal points to add 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
Return


FormattedStringINT

Error creating thumbnail: Unable to save thumbnail to destination
FormattedStringINT
Converts a signed int to a string of a fixed size. The value 5 with a length of 3 and a character of '0' would generate "003"  
Error creating thumbnail: Unable to save thumbnail to destination
- INT
Value
value to format 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
MinLength
The minimum length you want the string to be 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
PaddChar
Added character to padd the string with e.g. ' ' or '0' 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
Return


ImplodeFromByteArray

Error creating thumbnail: Unable to save thumbnail to destination
ImplodeFromByteArray
Creates an ASCII string from an array of byte values. Places a delimiter in between each value. e.g. {1,2,3,4} would become "1,2,3,4" 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
DataArray
 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Count
Number of values held in the array 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiter to add between values 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
Return


ImplodeFromFloatArray

Error creating thumbnail: Unable to save thumbnail to destination
ImplodeFromFloatArray
Creates an ASCII string from an array of float values. Places a delimiter in between each value. e.g. {1.1,2.2,3.3,4.4} would become "1.1,2.2,3.3,4.4" 
Error creating thumbnail: Unable to save thumbnail to destination
- FLOAT
DataArray
 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Count
Number of values held in the array 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiter to add between values 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Precision
Number of decimal points to add to each float value 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
Return


ImplodeFromINTArray

Error creating thumbnail: Unable to save thumbnail to destination
ImplodeFromINTArray
Creates an ASCII string from an array of integer values. Places a delimiter in between each value. e.g. {1,2,3,4} would become "1,2,3,4" 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
DataArray
 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Count
Number of values held in the array 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiter to add between values 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
Return


ImplodeFromStringArray

Error creating thumbnail: Unable to save thumbnail to destination
ImplodeFromStringArray
Creates an ASCII string from an array of string values. Places a delimiter in between each value. e.g. {"1","2","3","4"} would become "1,2,3,4" 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
DataArray
 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Count
Number of values held in the array 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
Delimiter
Delimiter to add between values 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
Return


InsertInto

Error creating thumbnail: Unable to save thumbnail to destination
InsertInto
Inserts a string into another string at the specified index position. 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
DataString
Data string to ammend 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
Insert
Data to insert 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
InsertionIndex
Index location in the string to insert the data 
Error creating thumbnail: Unable to save thumbnail to destination
- VOID
Return


MemCopy

Error creating thumbnail: Unable to save thumbnail to destination
MemCopy
Allows an array of bytes to be copied into another array of bytes at the chosen start address. 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
SourceData
Source data to copy from 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
SourceStartAddress
Address in the source to start copying data 
Error creating thumbnail: Unable to save thumbnail to destination
- BYTE
DestinationData
Data to copy the values into 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
DestinationStartAddress
Address in the destination to start inserting data 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
NumBytes
Number of values to copy from the source to the destination 
Error creating thumbnail: Unable to save thumbnail to destination
- VOID
Return


PositionOf

Error creating thumbnail: Unable to save thumbnail to destination
PositionOf
Scans a string to see if it contains a specific substring. Returns the location in the string if found, otherwise returns -1. 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StrData
Data string to scan 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StrMatch
String to look for in the data 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
SearchFrom
Starting index for the search, default 0. 
Error creating thumbnail: Unable to save thumbnail to destination
- INT
Return


RemoveFrom

Error creating thumbnail: Unable to save thumbnail to destination
RemoveFrom
Allows a set number of characters to be removed from a starting location in a string. 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
DataString
Data string to ammend 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
CharsToRemove
Number of characters to remove from the string 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
StartingIndex
Index location in the string to delete the data 
Error creating thumbnail: Unable to save thumbnail to destination
- VOID
Return


SearchAndReplace

Error creating thumbnail: Unable to save thumbnail to destination
SearchAndReplace
Attempts to find a specific string inside the data string and if found replaces with the provided replacement string. Returns the number of times the search pattern was found. 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StrData
Data string to scan 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StrSearch
String to look for in the data 
Error creating thumbnail: Unable to save thumbnail to destination
- STRING
StrReplace
String to insert into the data 
Error creating thumbnail: Unable to save thumbnail to destination
- UINT
Return


Property reference

Error creating thumbnail: Unable to save thumbnail to destination
Properties