Options

Deleting last character of a string and changing it

sabzamsabzam Member Posts: 1,149
Dear All,

I need to delete the last character of a string and then change the string to an integer. Can this be done in any way?

Comments

  • Options
    SavatageSavatage Member Posts: 7,142
    Look at the Nav C/side Reference Guide for "DELCHR" for details

    If I wanted to delete blank spaces at the end of "My field" then I would do something like this.
    "MyStringField" := DELCHR("MyStringField",'>',' ');

    You say you want to convert it to an integer - So I also have to assume that this text string contains only Numbers then you would use the "EVALUATE" function
    [Ok :=] EVALUATE(Variable, String)

    etc etc
  • Options
    sabzamsabzam Member Posts: 1,149
    Hi Savatage,

    Thanks for your prompt reply.
  • Options
    remco_rauschremco_rausch Member Posts: 68
    EVALUATE(Integer,COPYSTR(String,1,STRLEN(String)-1));
Sign In or Register to comment.