Sorry about that i might have given you too little info but heres an explenation.
Sub contains a string which suppousedly contains an illegal character.
Im defining all the characters, (in a char Array called "IllegalCharacters"),that are illegal for this string to have ex -> :
Im putting all the illegal characters into a charBuffer called "IllegalChar", im then searching the string for a illegal character if it exists in the string it retruns true.
Say the variable Sub contains = "Hi
"
Then the search will retrun true and then the replac should happen.
Up to this point theres no problems, but when i execute the statement:
sub = sub.replace(IllegalChar, "_");
Noting actually happens.... In other words the character " : " that should have been replaced with "_" hanst been replaced, so the string output is the same as the one i ran before the actual "if" statement
I get no errors from running this.
Hope this explains it better!