airspeed icon indicating copy to clipboard operation
airspeed copied to clipboard

Missing support for trim method.

Open rayniel95 opened this issue 1 year ago • 1 comments

I do not sure if this is a bug or a feature (according to https://github.com/purcell/airspeed/issues/47#issuecomment-638552958). But if I execute:

import airspeed

t = airspeed.Template("""
#set($some="      some  ")
$some.trim()
$some.strip()
""")
people = [{'name': 'Bill', 'age': 100}, {'name': 'Bob', 'age': 90}, {'name': 'Mark', 'age': 25}]
print(t.merge(locals()))

the output is:


$some.trim()
some

so, for some reason the trim method used to remove white spaces in Java need to be changed to its Python equivalent.

rayniel95 avatar Jul 19 '22 01:07 rayniel95

There are some extra string methods already, see here — if you'd like to submit a PR with a couple of little tests, I'd be happy to incorporate it.

purcell avatar Jul 20 '22 08:07 purcell