[Q] String>>withBlanksTrimmed

Lex Spoon lex at cc.gatech.edu
Thu Dec 11 22:54:34 UTC 2003


Michael Roberts <mike at mjr104.co.uk> wrote:
> I was wondering if it would be useful for String>>withBlanksTrimmed (and friends) to consider the null character as a blank as well.  This method could then strip strings with nulls at the end.
> 
> The null character is not considered because it is not a separator in Character>>isSeparator
> 

Seems odd -- can you describe a situation where a *text* string in
Squeak would end up with a null character?  I am imagining you have
bumped into one since you are asking!


Overall, my inclination would be to leave withBlanksTrimmed alone, but
perhaps to add a new method that does what you want.  Nulls don't seem
like blanks; they don't even seem like valid characters at all.  But
it's hard to say; it's hard to think about a character that shouldn't
even be there to begin with.

By the way, realize that you can do things like translate null's into
spaces, if you want.  See String>>translateWith: . 


Lex



More information about the Squeak-dev mailing list