How to remove characters from a string

Hi everybody! I have to delete a character from a string. My aim is to remove the _ from a string if the last char is a #
for example:
from "myText_#" to "myText#".
"myText" is a string with variable lenght...

Can anybody help me? Thank you!

Answers

  • navdevelopernavdeveloper Member Posts: 23
    Hi,

    Please try:-

    TextStr:='myText_#';
    IF COPYSTR(TextStr,STRLEN(TextStr)-1,STRLEN(TextStr))='#' THEN
    TextStr:=DELCHR(TextStr,'=','_');
  • taher.bhataher.bha Member Posts: 48
    edited 2017-04-06
    Just for sharing, you may try this (Here space, tab and _ are removed) :

    SpecialChar[1] := 9;
    SpecialChar[2] := ' ';
    SpecialChar[3] := '_';

    StrTxt := DELCHR(StrTxt, '=', SpecialChar);


    Where StrTxt and SpecialChar are both text variables
Sign In or Register to comment.