Hi friends. I have a process in which I get the text of a string and save it in a variable. This string has the following format: “1 - 9” or “1 - 22” The final numbers vary and are not always constant. This variable is in string format and I make a substring because I’m only interested in the last digits (remaining " 9" or “22”). Is there any way to be able to save in another variable the numbers that are in the format “009” or “022” depending on the value that is there each time? Thanks
PD: In my process, when I make the substring of the string, it only saves the last two digits, but in the event that the string is “1 - 100” I would lose the real value that I want to save. Is there another way to do it?
The string that I get is obtained through gettext activity.
But that string always varies, so what I want is to save the number and if it is from 2 to 9 I convert it to 009, if it is from 10 to 99 it is 010 or 099 and if it is 100 or greater then leave like 100.
Thank you all. You helped me and I was able to do it like this:
k = “1-23” —> a = k.split(" "c)(2).ToString —> c = a.ToString.PadLeft(3, "0"c) —> c =“023”