Friday, 30 August 2013

Removing pucntuation marks using ispunct()

Removing pucntuation marks using ispunct()

ispunct() words well when words are separated in this way "one, two;
three". Then it will remove ", ;" and replace with given character.
But if string is given in this manner"ts='TOK_STORE_ID';"then it will take
"ts='TOK_STORE_ID';" as one single token
or
"one,one, two;four$three two" as three tokens 1. "one,one" 2.
"two;four$three" 3. "two"
Is there any one so that "one,one, two;four$three two" could be considered
as "one one two four three two" each separate token?
Writing manual code like:
for(i=0;i<str.length();i++)
{
//validating each character
}
This operation will become very costly when string is very very long.
So is there any other function like ispunct()? or anything else?

No comments:

Post a Comment