[Newbies] Remove trailing spaces of aString

Tobias Pape Das.Linux at gmx.de
Fri Apr 27 20:09:28 UTC 2012


Am 2012-04-27 um 17:27 schrieb H. Hirzel:

> Hello
> 
> I use Squeak 4.3, Update 11860.
> 
> I want to remove the trailing spaces and or tabs and LF of a String
> 
> something like
> 'abc
> '
> 
> should just be
> 'abc'.
> 
> If I remember  that there was a method in class String to something
> like this. Is this correct?
> Is there a package with additional String convenience methods?

you probably want

'abc ' withoutTrailingBlanks

You can find that method by evaluating or printing

MethodFinder methodFor: { {'abc  '} . 'abc' } 
(a list with arguments  {'abc '}  and  an expected result ( 'abc' ))

HTH

Best
	-Tobias


More information about the Beginners mailing list