java - How many non visual symbols present in String -
java - How many non visual symbols present in String -
i doing parsing of excel document using poi api. since of cells contains line break(\n or \r) @ end , have remove characters before processing ( i'm working on url on excel document , calling url in programme using api.)
now want know how many non visual symbols nowadays in string returned excel parsed string , ? how java code can written accomplishing task ?
thanks in advance.
if taking tab spaces , form feed , new line , white spaces non visual characters called non graphic symbols in of languages , represented in ascii 0 32 (in decimal form)
the next link tell ascii codes doing , corresponding code http://msdn.microsoft.com/en-us/library/60ecse8t(v=vs.80).aspx
string str="default string"; integer ctr[] = new integer[32]; for(int i=0;i<32;i++){ ctr[i] = new integer(0); } for(int i=0;i<str.length() ;i++){ switch(str.charat(i)){ case 0 : ctr[0]++; break; case 1: ctr[1]++; break; case 2: ctr[2]++; break; //remaining counter case 32: ctr[32]++; break; } }
you can utilize ctr[] checking counter values
java string character apache-poi
Comments
Post a Comment