locked
remove blank spaces from string RRS feed

  • Question

  • How can I remove all blank spaces from string?
    Onenew
    Friday, September 18, 2009 10:52 AM

Answers

  • Use the String.Replace method
    • Marked as answer by Onenew Friday, September 18, 2009 12:21 PM
    Friday, September 18, 2009 10:57 AM

All replies

  • Use TRIM: myString.TRIM
    Only performance counts!
    Friday, September 18, 2009 10:57 AM
  • Use the String.Replace method
    • Marked as answer by Onenew Friday, September 18, 2009 12:21 PM
    Friday, September 18, 2009 10:57 AM
  • Hi, Silva,
       

    I want to remove all the blank spaces in a string and not just those on the left and right side, but also those  located within the string.
    Onenew
    Friday, September 18, 2009 11:11 AM
  • Then use Dave's code.
    Only performance counts!
    Friday, September 18, 2009 11:32 AM