Remove spaces from a string??

Jay2007Jay2007 Member Posts: 50
Does anyone know of a function to do this?

I've looked in Navision Help and searched Forum and can't seem to find any function available for this? :?:

Thanks,

Jay

Answers

  • pdjpdj Member Posts: 643
    DELCHR is your friend.

    Like this: NewString := DELCHR(OldString,'=',' '));
    Regards
    Peter
  • David_CoxDavid_Cox Member Posts: 509
    Look at the function DELCHR

    DELCHR (String)
    Use this function to delete one or more characters in a string.

    NewString := DELCHR(String [, Where] [, Which])

    Where

    =
    Character in String that matches a character in Which. (default)

    <
    Leading character in String that matches a character in Which.

    >
    Trailing character in String that matches a character in Which.



    If you do not define any characters, the system uses the equals sign (=) as the default for Where and spaces as the default for Which. It then deletes all spaces.

    So to remove leading and trailing spaces = NewString := DELCHR(String ,'<>');

    :)
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • Jay2007Jay2007 Member Posts: 50
    Excellent !! Thanks for your help :mrgreen:
Sign In or Register to comment.