Jump to content

Component: Advanced String Functions (Utility): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "width="90%" style="background-color:#D8C9D8; color:#4B008D;"" to "width="90%" class="mtx-class-macrohead""
 
(13 intermediate revisions by 3 users not shown)
Line 22: Line 22:


==Detailed description==
==Detailed description==


===Explode===
===Explode===
Line 42: Line 40:
==Examples==
==Examples==


''<span style="color:red;">No additional examples</span>''








''<span style="color:red;">No additional examples</span>''




Line 56: Line 54:
==Macro reference==
==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Contains===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''InsertInto'''
| width="90%" class="mtx-class-macrohead" | '''Contains'''
|-
|-
| colspan="2" | Inserts a string into another string at the specified index position.&nbsp;
| colspan="2" | Scans a string to see if it contains a specific substring. Returns 1 if found, otherwise returns 0.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | DataString
| width="90%" | StrData
|-
|-
| colspan="2" | Data string to ammend&nbsp;
| colspan="2" | Data string to scan&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Insert
| width="90%" | StrMatch
|-
|-
| colspan="2" | Data to insert&nbsp;
| colspan="2" | String to look for in the data&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | InsertionIndex
|-
| colspan="2" | Index location in the string to insert the data&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ExplodeToByteArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SearchAndReplace'''
| width="90%" class="mtx-class-macrohead" | '''ExplodeToByteArray'''
|-
|-
| 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.&nbsp;
| 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}&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | StrData
| width="90%" | StringInput
|-
| colspan="2" | Data string e.g. "1,2,3,4"&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Delimiter
|-
|-
| colspan="2" | Data string to scan&nbsp;
| colspan="2" | Delimiting character byte for example ','&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | StrSearch
| width="90%" | DataArray
|-
|-
| colspan="2" | String to look for in the data&nbsp;
| colspan="2" | Data array to hold the numberic values found&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | StrReplace
| width="90%" | MaxCount
|-
|-
| colspan="2" | String to insert into the data&nbsp;
| colspan="2" | Maximum number of values to return&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
Line 112: Line 112:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ExplodeToFloatArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ExplodeToByteArray'''
| width="90%" class="mtx-class-macrohead" | '''ExplodeToFloatArray'''
|-
|-
| 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}&nbsp;
| 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}&nbsp;
|-
|-
|-
|-
Line 130: Line 131:
| colspan="2" | Delimiting character byte for example ','&nbsp;
| colspan="2" | Delimiting character byte for example ','&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | DataArray
| width="90%" | DataArray
|-
|-
Line 145: Line 146:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ExplodeToINTArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''FormattedStringFloat'''
| width="90%" class="mtx-class-macrohead" | '''ExplodeToINTArray'''
|-
|-
| 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" &nbsp;
| 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}&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Value
| width="90%" | StringInput
|-
|-
| colspan="2" | value to format&nbsp;
| colspan="2" | Data string e.g. "1,2,3,4"&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | MinLength
| width="90%" | Delimiter
|-
|-
| colspan="2" | The minimum length you want the string to be&nbsp;
| colspan="2" | Delimiting character byte for example ','&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | PaddChar
| width="90%" | DataArray
|-
|-
| colspan="2" | Added character to padd the string with e.g. ' ' or '0'&nbsp;
| colspan="2" | Data array to hold the numberic values found&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Precision
| width="90%" | MaxCount
|-
|-
| colspan="2" | Number of decimal points to add&nbsp;
| colspan="2" | Maximum number of values to return&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ExplodeToStringArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ExplodeToStringArray'''
| 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"}&nbsp;
| 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"}&nbsp;
Line 211: Line 214:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===FormattedStringFloat===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ImplodeFromByteArray'''
| width="90%" class="mtx-class-macrohead" | '''FormattedStringFloat'''
|-
|-
| 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"&nbsp;
| 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" &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | Value
|-
|-
| colspan="2" | value to format&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DataArray
| width="90%" | MinLength
|-
|-
| colspan="2" | &nbsp;
| colspan="2" | The minimum length you want the string to be&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Count
| width="90%" | PaddChar
|-
|-
| colspan="2" | Number of values held in the array&nbsp;
| colspan="2" | Added character to padd the string with e.g. ' ' or '0'&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Delimiter
| width="90%" | Precision
|-
|-
| colspan="2" | Delimiter to add between values&nbsp;
| colspan="2" | Number of decimal points to add&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
Line 239: Line 248:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===FormattedStringINT===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Contains'''
| width="90%" class="mtx-class-macrohead" | '''FormattedStringINT'''
|-
|-
| colspan="2" | Scans a string to see if it contains a specific substring. Returns 1 if found, otherwise returns 0.&nbsp;
| 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" &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | Value
|-
|-
| colspan="2" | value to format&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | StrData
| width="90%" | MinLength
|-
|-
| colspan="2" | Data string to scan&nbsp;
| colspan="2" | The minimum length you want the string to be&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | StrMatch
| width="90%" | PaddChar
|-
|-
| colspan="2" | String to look for in the data&nbsp;
| colspan="2" | Added character to padd the string with e.g. ' ' or '0'&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ImplodeFromByteArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RemoveFrom'''
| width="90%" class="mtx-class-macrohead" | '''ImplodeFromByteArray'''
|-
|-
| colspan="2" | Allows a set number of characters to be removed from a starting location in a string.&nbsp;
| 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"&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | DataString
| width="90%" | DataArray
|-
|-
| colspan="2" | Data string to ammend&nbsp;
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | CharsToRemove
| width="90%" | Count
|-
|-
| colspan="2" | Number of characters to remove from the string&nbsp;
| colspan="2" | Number of values held in the array&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | StartingIndex
| width="90%" | Delimiter
|-
|-
| colspan="2" | Index location in the string to delete the data&nbsp;
| colspan="2" | Delimiter to add between values&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ImplodeFromFloatArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''PositionOf'''
| width="90%" class="mtx-class-macrohead" | '''ImplodeFromFloatArray'''
|-
|-
| colspan="2" | Scans a string to see if it contains a specific substring. Returns the location in the string if found, otherwise returns -1.&nbsp;
| 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"&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | DataArray
|-
|-
| colspan="2" | &nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | StrData
| width="90%" | Count
|-
|-
| colspan="2" | Data string to scan&nbsp;
| colspan="2" | Number of values held in the array&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | StrMatch
| width="90%" | Delimiter
|-
|-
| colspan="2" | String to look for in the data&nbsp;
| colspan="2" | Delimiter to add between values&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | SearchFrom
| width="90%" | Precision
|-
|-
| colspan="2" | Starting index for the search, default 0.&nbsp;
| colspan="2" | Number of decimal points to add to each float value&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ImplodeFromINTArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ExplodeToINTArray'''
| width="90%" class="mtx-class-macrohead" | '''ImplodeFromINTArray'''
|-
|-
| 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}&nbsp;
| 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"&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | StringInput
| width="90%" | DataArray
|-
|-
| colspan="2" | Data string e.g. "1,2,3,4"&nbsp;
| colspan="2" | &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Delimiter
|-
| colspan="2" | Delimiting character byte for example ','&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | DataArray
| width="90%" | Count
|-
|-
| colspan="2" | Data array to hold the numberic values found&nbsp;
| colspan="2" | Number of values held in the array&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | MaxCount
| width="90%" | Delimiter
|-
|-
| colspan="2" | Maximum number of values to return&nbsp;
| colspan="2" | Delimiter to add between values&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===ImplodeFromStringArray===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ImplodeFromStringArray'''
| 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"&nbsp;
| 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"&nbsp;
Line 379: Line 398:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===InsertInto===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ImplodeFromFloatArray'''
| width="90%" class="mtx-class-macrohead" | '''InsertInto'''
|-
|-
| 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"&nbsp;
| colspan="2" | Inserts a string into another string at the specified index position.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | DataString
|-
|-
| colspan="2" | Data string to ammend&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | DataArray
| width="90%" | Insert
|-
|-
| colspan="2" | &nbsp;
| colspan="2" | Data to insert&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Count
| width="90%" | InsertionIndex
|-
| colspan="2" | Index location in the string to insert the data&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
===MemCopy===
{| class="mtx-class-macrotable wikitable"
|-
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| 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.&nbsp;
|-
|-
| colspan="2" | Number of values held in the array&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Delimiter
| width="90%" | SourceData
|-
| colspan="2" | Source data to copy from&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | SourceStartAddress
|-
|-
| colspan="2" | Delimiter to add between values&nbsp;
| colspan="2" | Address in the source to start copying data&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="90%" | Precision
| width="90%" | DestinationData
|-
| colspan="2" | Data to copy the values into&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | DestinationStartAddress
|-
| colspan="2" | Address in the destination to start inserting data&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | NumBytes
|-
|-
| colspan="2" | Number of decimal points to add to each float value&nbsp;
| colspan="2" | Number of values to copy from the source to the destination&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===PositionOf===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ExplodeToFloatArray'''
| width="90%" class="mtx-class-macrohead" | '''PositionOf'''
|-
|-
| 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}&nbsp;
| colspan="2" | Scans a string to see if it contains a specific substring. Returns the location in the string if found, otherwise returns -1.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | StringInput
| width="90%" | StrData
|-
|-
| colspan="2" | Data string e.g. "1,2,3,4"&nbsp;
| colspan="2" | Data string to scan&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Delimiter
| width="90%" | StrMatch
|-
|-
| colspan="2" | Delimiting character byte for example ','&nbsp;
| colspan="2" | String to look for in the data&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT
| width="90%" | DataArray
|-
| colspan="2" | Data array to hold the numberic values found&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | MaxCount
| width="90%" | SearchFrom
|-
|-
| colspan="2" | Maximum number of values to return&nbsp;
| colspan="2" | Starting index for the search, default 0.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===RemoveFrom===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''FormattedStringINT'''
| width="90%" class="mtx-class-macrohead" | '''RemoveFrom'''
|-
|-
| 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" &nbsp;
| colspan="2" | Allows a set number of characters to be removed from a starting location in a string.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Value
| width="90%" | DataString
|-
|-
| colspan="2" | value to format&nbsp;
| colspan="2" | Data string to ammend&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | MinLength
| width="90%" | CharsToRemove
|-
|-
| colspan="2" | The minimum length you want the string to be&nbsp;
| colspan="2" | Number of characters to remove from the string&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | PaddChar
| width="90%" | StartingIndex
|-
|-
| colspan="2" | Added character to padd the string with e.g. ' ' or '0'&nbsp;
| colspan="2" | Index location in the string to delete the data&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===SearchAndReplace===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ImplodeFromINTArray'''
| width="90%" class="mtx-class-macrohead" | '''SearchAndReplace'''
|-
|-
| 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"&nbsp;
| 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.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | DataArray
| width="90%" | StrData
|-
|-
| colspan="2" | &nbsp;
| colspan="2" | Data string to scan&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Count
| width="90%" | StrSearch
|-
|-
| colspan="2" | Number of values held in the array&nbsp;
| colspan="2" | String to look for in the data&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Delimiter
| width="90%" | StrReplace
|-
|-
| colspan="2" | Delimiter to add between values&nbsp;
| colspan="2" | String to insert into the data&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| 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

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


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


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


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


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


FormattedStringFloat

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


FormattedStringINT

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


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


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


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


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


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


MemCopy

MemCopy
Allows an array of bytes to be copied into another array of bytes at the chosen start address. 
- BYTE SourceData
Source data to copy from 
- UINT SourceStartAddress
Address in the source to start copying data 
- BYTE DestinationData
Data to copy the values into 
- UINT DestinationStartAddress
Address in the destination to start inserting data 
- UINT NumBytes
Number of values to copy from the source to the destination 
- 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


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


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


Property reference

Properties