Tokenize a string: Difference between revisions

Content added Content deleted
(Add LabVIEW)
Line 709: Line 709:
<lang javascript>alert( "Hello,How,Are,You,Today".split(",").join(".") );</lang>
<lang javascript>alert( "Hello,How,Are,You,Today".split(",").join(".") );</lang>


=={{header|LabVIEW}}==
To tokenize the string, we use the Search/Split String function to split the string by its first comma. Add the beginning (up to, but not including the comma) to the end of the array, remove the first comma from the rest of the string, and pass it back through the shift register to the loop's next iteration. This is repeated until the string is empty. Printing is a simple matter of concatenation.<br/>
{{VI solution|LabVIEW_Tokenize_a_string.png}}
=={{header|Liberty BASIC}}==
=={{header|Liberty BASIC}}==
<lang lb>'Note that Liberty Basic's array usage can reach element #10 before having to DIM the array
<lang lb>'Note that Liberty Basic's array usage can reach element #10 before having to DIM the array