Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Copy and Paste in UI EditText box

New Here ,
Nov 10, 2008 Nov 10, 2008
I made a script where you input some text in an EditText box and get an XML tag with the same name (after some sanitizing).

In Windows it is ok. In OSX one user reports that if the EditText is filled through copying some text and paste it into the control you get an extra space at the end (no such thing in Windows).

Are there any known Copy and Paste quirks in OSX that I may have overlooked?
Any suggestion about this added extra space? Thank you

carlo
TOPICS
Scripting
403
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 11, 2008 Nov 11, 2008
Hi Carlo,

I don't know what's causing this, but you can just use a regex to strip
white spaces from the end of the string. Something like this:
string = string.replace(/\s+$/,"");

--
Harbs
http://www.in-tools.com
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 12, 2008 Nov 12, 2008
LATEST
thank you Harbs,

yes I solved stripping out the extra space something the way you suggested.

But still I would like to know the reason for that..

carlo
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines