iOS Question Contact Number Spaces

Discussion in 'iOS Questions' started by David Martinez, Apr 21, 2017.

  1. David Martinez

    David Martinez Member Licensed User

  2. Erel

    Erel Administrator Staff Member Licensed User

    Your code doesn't do anything.

    It should be:
    Code:
    strTempPhone = strTempPhone.Replace(" """)
     
  3. David Martinez

    David Martinez Member Licensed User

    The actual line of code was:

    Code:
    strTempPhone = Regex.Replace(" ", strTempPhone, "")
    I just posted the method.

    This code was working fine in the B4A version of my application but not in B4i so it seems to be specific to IOS Contact spaces.

    Anyway, your code seems to work fine...thanks!
     
  4. David Martinez

    David Martinez Member Licensed User

    This issue seems to have returned again. I thought it may be just the real phone but the simulator is doing it as well. Both Regex and string replace methods do not remove the space between the parentheses and the number ie. (323)<here>333-9876. This issue seems to be erratic.

    The answer below seems to work for people but I don't know how to implement it...

    http://stackoverflow.com/questions/...e-from-contact-number-fetched-from-phone-book
     
    Last edited: May 4, 2017
  5. Erel

    Erel Administrator Staff Member Licensed User

    Try this:
    Code:
    strTempPhone = Regex.Replace("\s", strTempPhone, "")
     
  6. David Martinez

    David Martinez Member Licensed User

    That seems to work well. Thanks for your help!
     
Loading...