How To Add Integer To Part Of the String

0
Hello,I have String attribute and part of the string is integer ( SMS900) and I want to add 1 to that 900 so the result should be SMS901. So I have written this logic but not working. Please help 'SMS'+toString((parseInteger('substring(SMS900,3)')+1))
asked
4 answers
4

Looks like you just have a couple quotes out of place. This works:

 

'SMS'+toString((parseInteger(substring('SMS900',3))+1))

 

You can test expressions here: https://repl-sandbox.mxapps.io/index.html

answered
1

A clean way is to handle as two parts:

  • A string (e.g. $prefix) or constant with value SMS
  • An integer (e.g. $number) with value 900, easy to add 1 for 901, etc.
  • Imagine you have a string $prefix and an integer $number
     
    $prefix + $number

     

answered
1

it worked ,thank you all .

answered
0

I am getting this error now, please help.

 

answered