如何使用逗号 (,) 作为分隔符 sscanf示例和fscanf示例答:void main(){rv = fscanf(filep, "%s", tokenstring);result = sscanf(tokenstring, "%[^','],%[^','],%[^','],%s", o, s, t, f);fp = atof(s);i = atoi(f);printf("%s/n %lf/n %s/n %d/n", o, fp, t, i);}如果你直接使用fscanf读取文件中存放的字符串"...
java编程将",a,b,c,e,f,,,"以逗号为分隔符切分成字符串组成的数组,并推...答:public class split { public static void main(String[] args) { String str = ",a,b,c,e,f,,,";//数据 String[] str1 = str.split(",");for(String str2: str1){ System.out.println(str2);} } }