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

From Flowcode Help
Jump to navigationJump to search
Line 22: Line 22:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 43: Line 45:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 51: Line 55:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
  
  
Line 89: Line 95:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===SearchAndReplace===
 
===SearchAndReplace===
Line 117: Line 124:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ExplodeToByteArray===
 
===ExplodeToByteArray===
Line 150: Line 158:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===FormattedStringFloat===
 
===FormattedStringFloat===
Line 183: Line 192:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ExplodeToStringArray===
 
===ExplodeToStringArray===
Line 216: Line 226:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ImplodeFromByteArray===
 
===ImplodeFromByteArray===
Line 244: Line 255:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===Contains===
 
===Contains===
Line 267: Line 279:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===RemoveFrom===
 
===RemoveFrom===
Line 295: Line 308:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===PositionOf===
 
===PositionOf===
Line 323: Line 337:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ExplodeToINTArray===
 
===ExplodeToINTArray===
Line 356: Line 371:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ImplodeFromStringArray===
 
===ImplodeFromStringArray===
Line 384: Line 400:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ImplodeFromFloatArray===
 
===ImplodeFromFloatArray===
Line 417: Line 434:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ExplodeToFloatArray===
 
===ExplodeToFloatArray===
Line 450: Line 468:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===FormattedStringINT===
 
===FormattedStringINT===
Line 478: Line 497:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
 
===ImplodeFromINTArray===
 
===ImplodeFromINTArray===
Line 506: Line 526:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 +
  
  

Revision as of 11:38, 3 February 2023

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

Fc9-comp-macro.png InsertInto
Inserts a string into another string at the specified index position. 
Fc9-string-icon.png - STRING DataString
Data string to ammend 
Fc9-string-icon.png - STRING Insert
Data to insert 
Fc9-u16-icon.png - UINT InsertionIndex
Index location in the string to insert the data 
Fc9-void-icon.png - VOID Return


SearchAndReplace

Fc9-comp-macro.png 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. 
Fc9-string-icon.png - STRING StrData
Data string to scan 
Fc9-string-icon.png - STRING StrSearch
String to look for in the data 
Fc9-string-icon.png - STRING StrReplace
String to insert into the data 
Fc9-u16-icon.png - UINT Return


ExplodeToByteArray

Fc9-comp-macro.png 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} 
Fc9-string-icon.png - STRING StringInput
Data string e.g. "1,2,3,4" 
Fc9-u8-icon.png - BYTE Delimiter
Delimiting character byte for example ',' 
Fc9-u8-icon.png - BYTE DataArray
Data array to hold the numberic values found 
Fc9-u16-icon.png - UINT MaxCount
Maximum number of values to return 
Fc9-u16-icon.png - UINT Return


FormattedStringFloat

Fc9-comp-macro.png 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"  
Fc9-f32-icon.png - FLOAT Value
value to format 
Fc9-u8-icon.png - BYTE MinLength
The minimum length you want the string to be 
Fc9-u8-icon.png - BYTE PaddChar
Added character to padd the string with e.g. ' ' or '0' 
Fc9-u8-icon.png - BYTE Precision
Number of decimal points to add 
Fc9-string-icon.png - STRING Return


ExplodeToStringArray

Fc9-comp-macro.png 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"} 
Fc9-string-icon.png - STRING StringInput
Data string e.g. "1,2,3,4" 
Fc9-u8-icon.png - BYTE Delimiter
Delimiting character byte for example ',' 
Fc9-string-icon.png - STRING DataArray
Data array to hold the numberic values found 
Fc9-u16-icon.png - UINT MaxCount
Maximum number of values to return 
Fc9-u16-icon.png - UINT Return


ImplodeFromByteArray

Fc9-comp-macro.png 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" 
Fc9-u8-icon.png - BYTE DataArray
 
Fc9-u16-icon.png - UINT Count
Number of values held in the array 
Fc9-u8-icon.png - BYTE Delimiter
Delimiter to add between values 
Fc9-string-icon.png - STRING Return


Contains

Fc9-comp-macro.png Contains
Scans a string to see if it contains a specific substring. Returns 1 if found, otherwise returns 0. 
Fc9-string-icon.png - STRING StrData
Data string to scan 
Fc9-string-icon.png - STRING StrMatch
String to look for in the data 
Fc9-bool-icon.png - BOOL Return


RemoveFrom

Fc9-comp-macro.png RemoveFrom
Allows a set number of characters to be removed from a starting location in a string. 
Fc9-string-icon.png - STRING DataString
Data string to ammend 
Fc9-u16-icon.png - UINT CharsToRemove
Number of characters to remove from the string 
Fc9-u16-icon.png - UINT StartingIndex
Index location in the string to delete the data 
Fc9-void-icon.png - VOID Return


PositionOf

Fc9-comp-macro.png PositionOf
Scans a string to see if it contains a specific substring. Returns the location in the string if found, otherwise returns -1. 
Fc9-string-icon.png - STRING StrData
Data string to scan 
Fc9-string-icon.png - STRING StrMatch
String to look for in the data 
Fc9-u16-icon.png - UINT SearchFrom
Starting index for the search, default 0. 
Fc9-s16-icon.png - INT Return


ExplodeToINTArray

Fc9-comp-macro.png 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} 
Fc9-string-icon.png - STRING StringInput
Data string e.g. "1,2,3,4" 
Fc9-u8-icon.png - BYTE Delimiter
Delimiting character byte for example ',' 
Fc9-u16-icon.png - UINT DataArray
Data array to hold the numberic values found 
Fc9-u16-icon.png - UINT MaxCount
Maximum number of values to return 
Fc9-u16-icon.png - UINT Return


ImplodeFromStringArray

Fc9-comp-macro.png 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" 
Fc9-string-icon.png - STRING DataArray
 
Fc9-u16-icon.png - UINT Count
Number of values held in the array 
Fc9-u8-icon.png - BYTE Delimiter
Delimiter to add between values 
Fc9-string-icon.png - STRING Return


ImplodeFromFloatArray

Fc9-comp-macro.png 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" 
Fc9-f32-icon.png - FLOAT DataArray
 
Fc9-u16-icon.png - UINT Count
Number of values held in the array 
Fc9-u8-icon.png - BYTE Delimiter
Delimiter to add between values 
Fc9-u8-icon.png - BYTE Precision
Number of decimal points to add to each float value 
Fc9-string-icon.png - STRING Return


ExplodeToFloatArray

Fc9-comp-macro.png 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} 
Fc9-string-icon.png - STRING StringInput
Data string e.g. "1,2,3,4" 
Fc9-u8-icon.png - BYTE Delimiter
Delimiting character byte for example ',' 
Fc9-f32-icon.png - FLOAT DataArray
Data array to hold the numberic values found 
Fc9-u16-icon.png - UINT MaxCount
Maximum number of values to return 
Fc9-u16-icon.png - UINT Return


FormattedStringINT

Fc9-comp-macro.png 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"  
Fc9-s16-icon.png - INT Value
value to format 
Fc9-u8-icon.png - BYTE MinLength
The minimum length you want the string to be 
Fc9-u8-icon.png - BYTE PaddChar
Added character to padd the string with e.g. ' ' or '0' 
Fc9-string-icon.png - STRING Return


ImplodeFromINTArray

Fc9-comp-macro.png 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" 
Fc9-u16-icon.png - UINT DataArray
 
Fc9-u16-icon.png - UINT Count
Number of values held in the array 
Fc9-u8-icon.png - BYTE Delimiter
Delimiter to add between values 
Fc9-string-icon.png - STRING Return



Property reference

Fc9-prop-icon.png Properties