Greetings everyone... I need to Trim
a String
. But I want to remove all the repeated blank spaces within the String itself, not only at the end or
Besides using extension methods -- likely a good candidate here -- it is also possible to "wrap" an object (e.g. "object composition"). As long as the wrapped form contains no more information than the thing being wrapped then the wrapped item may be cleanly passed through implicit or explicit conversions with no loss of information: just a change of type/interface.
Happy coding.