0

I've a weird problem here. When you use this:

ContactsContract.CommonDataKinds.Phone.NUMBER

It returns 0123 4567890 (or something like that).

Now the SPACE in between these numbers is causing issues in a webservice so I was asked to trim it. I can't. I've tried the .trim() function but it doesn't seem to work.

The only reason I can think of is that this isn't exactly a space. But how can I check? If I copy paste this from the logcat to a text file, it says its a SPACE (ASCII 32). But if it is, why isn't .trim() removing it?

Asim
  • 6,962
  • 8
  • 38
  • 61
  • trim() function doesn't work like that..it only removes spaces from the start and at the end..you can always replace them with empty string – Tomislav Novoselec Jan 21 '13 at 10:19
  • @TomislavNovoselec I'm so stupid. Thanks a lot. Add it as an answer so I can mark it correct and so that this question can be closed. – Asim Jan 21 '13 at 10:36

1 Answers1

1

trim() function doesn't work like that..it only removes spaces from the start and at the end..you can always replace them with empty string

Tomislav Novoselec
  • 4,570
  • 2
  • 27
  • 22