RAPID funtion to remove white space

scottdf93scottdf93 United Kingdom
Is there a function that will remove all leading white space in a string?

Something equivalent to string.Trim() in c#

Comments

  • lemster68lemster68 United States ✭✭✭
    You could write your own, or perhaps a routine.  There is a predefined data, STR_WHITE, for blank space.  There are a lot of string functions available and I suppose you could use one or more to clear out any undesired white spaces.
    Lee Justice
  • Oliver_LOliver_L NRW, Germany
      FUNC string StrTrim(string sInput, string sTrim)
        VAR string sPart;
        VAR string sReturn; 
        
          FOR i FROM 1 TO StrLen(sInput) DO
            sPart:=StrPart(sInput,i,1);
            IF sPart<>sTrim sReturn:=sReturn+sPart;
          ENDFOR
          
          RETURN sReturn;
      ENDFUNC

    Needed and created it last week.
    Cheers
Sign In or Register to comment.