Reference for Wiring version 0024+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Name

splitString()

Examples
String str = String("1240,87000,10,30,20,1200");  // the string to split
Vector < long > numVector;  // long Vector

void setup() {
  Serial.begin(9600); 
  pinMode(48, OUTPUT);  // turn ON wiring hardware LED
  digitalWrite(48, HIGH);
    
  splitString(str,',',numVector);  // split str using ',' as separator and store the resolt on numVector
  for(int i=0; i
Description Splits a string around matches of the given delimiter char and returns the result in a Vector. The string to split must be made in the format in the example: "numeric value 1'delim'numeric value 2'delim'...'delim'numeric value n".
Syntax
splitString(data, delim, result)
Parameters
data String: the string to split
delim char: the char used as delimiter
result Vector: vector of int or long numbers with the result
Returns none
Usage Application
Related String
Vector
Updated on November 01, 2009 01:22:34pm PST

Creative Commons License