Remove 1st digit

I have the next String
OrderNum = “02017586”
I want to remove the 1st digit that the result will be
OrderNum = “2017586”
How to do that please ?

HI @mironb

OrderNum = "02017586"
Output= OrderNum.TrimStart("0"c)

Regards

1 Like

Hi @mironb

OrderNum.Substring(1)

1 Like

Hi @mironb

If you wanted to remove only if the first number is zero then please use the syntax in the above mentioned post.

If you want to remove any number which is in the first position means then please use the below syntax.

OrderNum = "02017586"
  
OrderNum.Remove(0,1)

Regards

@mironb

OrderNum = String.Join("", OrderNum.Skip(1))


OrderNum.SubString(1)
image

Can Also Follow this Method
image
Where charcterList is Ienumerable of char
image

Or

image

Hi @mironb

OrderNum: “02017586”

OrderNum.Substring(1)

OrderNum: “2017586”

Happy Automation :slight_smile:
Cheers!!

hi @mironb
Value=OrderNum.Substring(1, OrderNum.Length - 1)
or
Value=OrderNum.Substring(1)

Thanks!

Hi ,
->you can use substring(1) to removes the first digit.

->Can use Remove(0, 1) ,removes one digit starting from the index 0

->Can also convert string to array of characters and skip first character.
Screenshot 2024-01-30 120345
Screenshot 2024-01-30 120448
Screenshot 2024-01-30 120534

OrderNum.Substring(1)