Component: Advanced String Functions (Utility): Difference between revisions
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable"" |
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead"" |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 57: | Line 57: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 81: | Line 81: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 115: | Line 115: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 149: | Line 149: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 183: | Line 183: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 217: | Line 217: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 251: | Line 251: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 280: | Line 280: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 309: | Line 309: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 343: | Line 343: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 372: | Line 372: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 401: | Line 401: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 430: | Line 430: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 469: | Line 469: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 498: | Line 498: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 527: | Line 527: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | 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 |