|
|
| Line 22: |
Line 22: |
|
| |
|
| ==Detailed description== | | ==Detailed description== |
| | |
| | |
|
| |
|
|
| |
|
| Line 41: |
Line 43: |
|
| |
|
| ==Examples== | | ==Examples== |
| | |
| | |
|
| |
|
|
| |
|
| Line 47: |
Line 51: |
|
| |
|
| ''<span style="color:red;">No additional examples</span>'' | | ''<span style="color:red;">No additional examples</span>'' |
| | |
| | |
|
| |
|
|
| |
|
| Line 57: |
Line 63: |
|
| |
|
| ===InsertInto=== | | ===InsertInto=== |
|
| |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 84: |
Line 89: |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
|
| |
|
| |
|
| ===SearchAndReplace=== | | ===SearchAndReplace=== |
|
| |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 115: |
Line 118: |
| |} | | |} |
|
| |
|
| | | ===ExplodeToByteArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 148: |
Line 151: |
| |} | | |} |
|
| |
|
| | | ===FormattedStringFloat=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 181: |
Line 184: |
| |} | | |} |
|
| |
|
| | | ===ExplodeToStringArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 214: |
Line 217: |
| |} | | |} |
|
| |
|
| | | ===ImplodeFromByteArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 242: |
Line 245: |
| |} | | |} |
|
| |
|
| | | ===Contains=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 265: |
Line 268: |
| |} | | |} |
|
| |
|
| | | ===RemoveFrom=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 293: |
Line 296: |
| |} | | |} |
|
| |
|
| | | ===PositionOf=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 321: |
Line 324: |
| |} | | |} |
|
| |
|
| | | ===ExplodeToINTArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 354: |
Line 357: |
| |} | | |} |
|
| |
|
| | | ===ImplodeFromStringArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 382: |
Line 385: |
| |} | | |} |
|
| |
|
| | | ===ImplodeFromFloatArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 415: |
Line 418: |
| |} | | |} |
|
| |
|
| | | ===ExplodeToFloatArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 448: |
Line 451: |
| |} | | |} |
|
| |
|
| | | ===FormattedStringINT=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 476: |
Line 479: |
| |} | | |} |
|
| |
|
| | | ===ImplodeFromINTArray=== |
| {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" |
| |- | | |- |
| Line 503: |
Line 506: |
| | width="90%" style="border-top: 2px solid #000;" | ''Return'' | | | width="90%" style="border-top: 2px solid #000;" | ''Return'' |
| |} | | |} |
| | |
| | |
|
| |
|
| ==Property reference== | | ==Property reference== |
| 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
InsertInto
|
InsertInto
|
| Inserts a string into another string at the specified index position.
|
- STRING
|
DataString
|
| Data string to ammend
|
- STRING
|
Insert
|
| Data to insert
|
- UINT
|
InsertionIndex
|
| Index location in the string to insert the data
|
- VOID
|
Return
|
SearchAndReplace
|
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.
|
- STRING
|
StrData
|
| Data string to scan
|
- STRING
|
StrSearch
|
| String to look for in the data
|
- STRING
|
StrReplace
|
| String to insert into the data
|
- UINT
|
Return
|
ExplodeToByteArray
|
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}
|
- STRING
|
StringInput
|
| Data string e.g. "1,2,3,4"
|
- BYTE
|
Delimiter
|
| Delimiting character byte for example ','
|
- BYTE
|
DataArray
|
| Data array to hold the numberic values found
|
- UINT
|
MaxCount
|
| Maximum number of values to return
|
- UINT
|
Return
|
|
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"
|
- FLOAT
|
Value
|
| value to format
|
- BYTE
|
MinLength
|
| The minimum length you want the string to be
|
- BYTE
|
PaddChar
|
| Added character to padd the string with e.g. ' ' or '0'
|
- BYTE
|
Precision
|
| Number of decimal points to add
|
- STRING
|
Return
|
ExplodeToStringArray
|
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"}
|
- STRING
|
StringInput
|
| Data string e.g. "1,2,3,4"
|
- BYTE
|
Delimiter
|
| Delimiting character byte for example ','
|
- STRING
|
DataArray
|
| Data array to hold the numberic values found
|
- UINT
|
MaxCount
|
| Maximum number of values to return
|
- UINT
|
Return
|
ImplodeFromByteArray
|
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"
|
- BYTE
|
DataArray
|
|
|
- UINT
|
Count
|
| Number of values held in the array
|
- BYTE
|
Delimiter
|
| Delimiter to add between values
|
- STRING
|
Return
|
Contains
|
Contains
|
| Scans a string to see if it contains a specific substring. Returns 1 if found, otherwise returns 0.
|
- STRING
|
StrData
|
| Data string to scan
|
- STRING
|
StrMatch
|
| String to look for in the data
|
- BOOL
|
Return
|
RemoveFrom
|
RemoveFrom
|
| Allows a set number of characters to be removed from a starting location in a string.
|
- STRING
|
DataString
|
| Data string to ammend
|
- UINT
|
CharsToRemove
|
| Number of characters to remove from the string
|
- UINT
|
StartingIndex
|
| Index location in the string to delete the data
|
- VOID
|
Return
|
PositionOf
|
PositionOf
|
| Scans a string to see if it contains a specific substring. Returns the location in the string if found, otherwise returns -1.
|
- STRING
|
StrData
|
| Data string to scan
|
- STRING
|
StrMatch
|
| String to look for in the data
|
- UINT
|
SearchFrom
|
| Starting index for the search, default 0.
|
- INT
|
Return
|
ExplodeToINTArray
|
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}
|
- STRING
|
StringInput
|
| Data string e.g. "1,2,3,4"
|
- BYTE
|
Delimiter
|
| Delimiting character byte for example ','
|
- UINT
|
DataArray
|
| Data array to hold the numberic values found
|
- UINT
|
MaxCount
|
| Maximum number of values to return
|
- UINT
|
Return
|
ImplodeFromStringArray
|
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"
|
- STRING
|
DataArray
|
|
|
- UINT
|
Count
|
| Number of values held in the array
|
- BYTE
|
Delimiter
|
| Delimiter to add between values
|
- STRING
|
Return
|
ImplodeFromFloatArray
|
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"
|
- FLOAT
|
DataArray
|
|
|
- UINT
|
Count
|
| Number of values held in the array
|
- BYTE
|
Delimiter
|
| Delimiter to add between values
|
- BYTE
|
Precision
|
| Number of decimal points to add to each float value
|
- STRING
|
Return
|
ExplodeToFloatArray
|
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}
|
- STRING
|
StringInput
|
| Data string e.g. "1,2,3,4"
|
- BYTE
|
Delimiter
|
| Delimiting character byte for example ','
|
- FLOAT
|
DataArray
|
| Data array to hold the numberic values found
|
- UINT
|
MaxCount
|
| Maximum number of values to return
|
- UINT
|
Return
|
|
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"
|
- INT
|
Value
|
| value to format
|
- BYTE
|
MinLength
|
| The minimum length you want the string to be
|
- BYTE
|
PaddChar
|
| Added character to padd the string with e.g. ' ' or '0'
|
- STRING
|
Return
|
ImplodeFromINTArray
|
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"
|
- UINT
|
DataArray
|
|
|
- UINT
|
Count
|
| Number of values held in the array
|
- BYTE
|
Delimiter
|
| Delimiter to add between values
|
- STRING
|
Return
|
Property reference
|
Properties
|