EAGLE Help Light

strsplit()???

Funkce
Splits a string into separate fields.

Zápis
int strsplit(string &array[], string s, char separator);

Returns
The strsplit function returns the number of entries copied into array.

Description
strsplit splits the string s at the given separator and stores the resulting fields in the array.

If separator is the newline character ("\n") the last field will be silently dropped if it is empty. This is done to have a text file that consists of N lines (each of which is terminated with a newline) and is read in with the fileread() function to be split into an array of N strings. With any other separator an empty field at the end of the string will count, so "a:b:c:" will result in 4 fields, the last of which is empty.

Viz také strjoin, lookup, fileread

Příklad


string a[];
int n = strsplit(a, "Field 1:Field 2:Field 3", ":");


OBSAH Translation © 2001 ELCAD v.o.s., Copyright © 2001 CadSoft Computer GmbH