For example I\'m extracting a text String from a text file and I need those words to form an array. However, when I do all that some words end with comma (,) or a full stop (.)
Also an alternative way of solving your problem: you might also want to consider using a StringTokenizer to read the file and set the delimiters to be the characters you don't want to be part of words.