strtok函数分割字符串,最后一个分割错误,帮忙分析下
token = (char *)strtok(lr_eval_string("{str}"),separators); // Get the first tokenif (!token) {
lr_output_message ("No tokens found in string!");
return( -1 );
} else{
while (token != NULL ) { // While valid tokens are returned
lr_output_message ("--%s---", token);
strcpy(val,token);
lr_output_message("Val # is: %s", val);
// Get the next token
lr_save_string(val,"row_idB");
lr_output_message("--%s--", lr_eval_string("{row_idB}"));
token = (char *)strtok(NULL, separators);
i++;
}
str是这样的字符,"4afdfdfadfdfdfad","4afdfd456fdfdfad","4afdfdfaafdfdfdfdfd";
最后一个字符串分割
时分割出来了fadfad,dfd....好多个。是什么原因
页:
[1]