I have the following SQL Server code which I would like to do in C# code. The logic is - to remove leading zeros please help me to translate the code into C#.
DECLARE @TESTVariable as varchar(500)
Set @TESTVariable = '00013025990'
SELECT Substring(@TESTVariable, Patindex('%[^0 ]%', @TESTVariable + ' '), Len(@TESTVariable))
output expected
| input | output |
|---|---|
| '001' | '1' |
| '00' | '0' |
| '00013025990' | '13025990' |
str.TrimStart('0')