Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trim whitespaces from a string?
2016-03-05, 01:42
Post: #1
Trim whitespaces from a string?
For some reason, Acer did store the manufacturer and product in my Acer Aspire One as:

Code:
"Acer      "
"Aspire one      "

And when outputting this to the screen, the added spaces look weird:

Code:
"Acer      Aspire one      boot menu"

I found several settings types which convert the data, e.g. uristring, hex, etc. ... but I didn't find a way to just trim the excessive spaces.

I found this discussion on the mailing list, but the mentioned trick doesn't work anymore and there's no other solution to the problem in that thread. There was also a proposal for a new "trim" command, but that's where the thread ended.

Is there a way to trim whitespaces?
Find all posts by this user
Quote this message in a reply
2016-03-17, 13:21
Post: #2
RE: Trim whitespaces from a string?
String manipulation functions have not been implemented as we're still discussing how they should be provided to the end-user (API). For now you'll need to send it to a server-side scripting language via HTTP (GET parameters) and truncate them and return a script with them cleaned.
Visit this user's website Find all posts by this user
Quote this message in a reply
2016-05-24, 07:12 (This post was last modified: 2016-05-30 09:10 by sspans.)
Post: #3
RE: Trim whitespaces from a string?
Any progress on this?

I'm hitting the same issue with limited workarounds possible after http://git.ipxe.org/ipxe.git/commitdiff/b5f5f73 got merged.
We're currently running with a forward ported version of the patch by Christian Hesse from 29 Nov 2013.

https://gist.github.com/sspans/afbfb9387...78b0378634
Find all posts by this user
Quote this message in a reply
2016-06-10, 13:56
Post: #4
RE: Trim whitespaces from a string?
Unfortunately the patch does seem to break on efi in particular situations.
I'm working on a way to resolve this.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)