Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Computers (https://www.askmehelpdesk.com/forumdisplay.php?f=242)
-   -   Remove blank spaces (https://www.askmehelpdesk.com/showthread.php?t=19161)

  • Jan 30, 2006, 01:09 AM
    lakhwindergill
    How cam we remove the blank spaces in a String like " a s k " to make it "ask"
  • Jan 30, 2006, 06:51 AM
    fredg
    Hi,
    Since I don't know exactly what you are trying to do, I will offer this:
    In the "a s k", place the curson right after the "a", can press the Delete key on the keypad. That should delete the space, then do the same right after the "s".
    Best of luck.
  • Jan 30, 2006, 07:04 AM
    colbtech
    If you know that the string is a series of characters with a space that you wish to remove rather than a sentence. I would be inclined to write a small program something like:

    LET A$ = " a s k "
    LET B$ = ""
    LET L=LEN(A$)
    FOR I=1 TO L
    IF MID$(A$,I,1)=" " THEN MID$(B$,I,1)="" ELSE MID$(B$,I,1)=MID$(A$,I,1)
    NEXT I

    This is a simple BASIC program. Don't even know if it is still used anymore, but the gist of it should be clear(ish)

    Assign A$ to your unknow string.
    Assign B$ to nothing
    Determine the length of your unknown string
    Start loop
    Check if the nth character is a space, if it is don't add that character to B$, if it is then add the character to B$
    Check the next character
  • Jan 30, 2006, 07:34 AM
    ScottGem
    You need to define what you are doing mre completely. I suspect this should have gone in the Programming forum. If so then you need to define what programming language or platform you are using.

    Please post back so we can provide definitive help.

  • All times are GMT -7. The time now is 11:22 AM.