Component: Advanced String Functions (Utility): Difference between revisions
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (One intermediate revision by the same user not shown) | |||
| Line 58: | Line 58: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Contains''' | ||
|- | |- | ||
| colspan="2" | Scans a string to see if it contains a specific substring. Returns 1 if found, otherwise returns 0. | | colspan="2" | Scans a string to see if it contains a specific substring. Returns 1 if found, otherwise returns 0. | ||
| Line 82: | Line 82: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ExplodeToByteArray''' | ||
|- | |- | ||
| colspan="2" | 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} | | colspan="2" | 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} | ||
| Line 116: | Line 116: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ExplodeToFloatArray''' | ||
|- | |- | ||
| colspan="2" | 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} | | colspan="2" | 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} | ||
| Line 150: | Line 150: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ExplodeToINTArray''' | ||
|- | |- | ||
| colspan="2" | 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} | | colspan="2" | 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} | ||
| Line 184: | Line 184: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ExplodeToStringArray''' | ||
|- | |- | ||
| colspan="2" | 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"} | | colspan="2" | 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"} | ||
| Line 218: | Line 218: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FormattedStringFloat''' | ||
|- | |- | ||
| colspan="2" | 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" | | colspan="2" | 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" | ||
| Line 252: | Line 252: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''FormattedStringINT''' | ||
|- | |- | ||
| colspan="2" | 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" | | colspan="2" | 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" | ||
| Line 281: | Line 281: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ImplodeFromByteArray''' | ||
|- | |- | ||
| colspan="2" | 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" | | colspan="2" | 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" | ||
| Line 310: | Line 310: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ImplodeFromFloatArray''' | ||
|- | |- | ||
| colspan="2" | 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" | | colspan="2" | 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" | ||
| Line 344: | Line 344: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ImplodeFromINTArray''' | ||
|- | |- | ||
| colspan="2" | 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" | | colspan="2" | 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" | ||
| Line 373: | Line 373: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''ImplodeFromStringArray''' | ||
|- | |- | ||
| colspan="2" | 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" | | colspan="2" | 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" | ||
| Line 402: | Line 402: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''InsertInto''' | ||
|- | |- | ||
| colspan="2" | Inserts a string into another string at the specified index position. | | colspan="2" | Inserts a string into another string at the specified index position. | ||
| Line 431: | Line 431: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''MemCopy''' | ||
|- | |- | ||
| colspan="2" | Allows an array of bytes to be copied into another array of bytes at the chosen start address. | | colspan="2" | Allows an array of bytes to be copied into another array of bytes at the chosen start address. | ||
| Line 470: | Line 470: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''PositionOf''' | ||
|- | |- | ||
| colspan="2" | Scans a string to see if it contains a specific substring. Returns the location in the string if found, otherwise returns -1. | | colspan="2" | Scans a string to see if it contains a specific substring. Returns the location in the string if found, otherwise returns -1. | ||
| Line 499: | Line 499: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''RemoveFrom''' | ||
|- | |- | ||
| colspan="2" | Allows a set number of characters to be removed from a starting location in a string. | | colspan="2" | Allows a set number of characters to be removed from a starting location in a string. | ||
| Line 528: | Line 528: | ||
|- | |- | ||
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''SearchAndReplace''' | ||
|- | |- | ||
| colspan="2" | 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. | | colspan="2" | 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. | ||
| Line 557: | Line 557: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]] | ||
| width="90%" | | width="90%" class="mtx-class-macrohead" | '''Properties''' | ||
|- | |- | ||
|} | |} | ||
Latest revision as of 14:22, 13 July 2026
| 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
ExplodeToByteArray
ExplodeToFloatArray
ExplodeToINTArray
ExplodeToStringArray
FormattedStringFloat
FormattedStringINT
ImplodeFromByteArray
ImplodeFromFloatArray
ImplodeFromINTArray
ImplodeFromStringArray
InsertInto
MemCopy
PositionOf
RemoveFrom
SearchAndReplace
Property reference
| Properties |