how to remove spaces and special characters in a string using isalpha?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ZS369
    New Member
    • Aug 2018
    • 8

    how to remove spaces and special characters in a string using isalpha?

    Wondering how to take a string and remove special characters and spaces.

    Example: how are you?
    would be: howareyou
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Call isalpha on each characters of your string and if isalpha returns true,then append the character to your new string.


    I can help you correct code you have written but I cannot write the code for you.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      You should decide whether you want to copy a space-removed version of the input string into a new output string or if you want to modify the input string itself.

      Either approach can be legitimate, but the way you solve the problem will be different.

      Comment

      Working...