0
I came across a situation, I need to recover the user code that comes for example like this: '000063'. But my need was to take only the value of '63', use the . Trimstart would be a good option?
this.txtARQUIVO.Text = item.ALUNOID + "_" + item.CODESTAGIO.TrimStart('0') + ".jpg";
Yes, it’s the right option.
– Maniero
@Maniero would have a better way of asking the question to be in the scope of the site? is that not understand very well why is outside
– PedroBelino
I think not because the question can be answered with a yes or no. Unless a wrong answer has happened. It doesn’t help that the answer has a positive.
– Maniero
You can use Regex for this too, but with trimstart it’s easier...
Regex RemoverZeros = new Regex(@"^0+(?=\d)");
Use:removeLeadingZeroesReg.Replace(item.CODESTAGIO, "")
– Alvaro Alves