i'm attempting to write a Java class to perform basic string manipulation functions.
I want this class to be callable in some manner like:
String tmp = StringUtils.RemoveSpaces(str).RemoveSlashes();
or
String tmp = StringUtils.RemoveSlashes(str).RemoveSpaces();
I'm struggling to figure out how to structure this class. I guess some method or variable within the class will be static, and the methods will return 'this'. So how would my RemoveSlashes method return a string to 'tmp' if it's returning this? Will i be forced to use RemoveSlashes.toString() or RemoveSlashes.getString() or something to that effect. Seems a bit convoluted...
I'd appreciate if you could help me with the method definitions and return types.