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.
Example
string a[]; int n = strsplit(a, "Field 1:Field 2:Field 3", ':');
Index | Copyright © 2005 CadSoft Computer GmbH |