Jim Schwetz
asked on
Have a C# method that will receive a List<string> of numbers, and i need to remove the leading zeros only.
Have a C# method that will receive a List<string> of numbers, and i need to remove the leading zeros only.
0000012.74
-000001.3
public List<string> RemoveLeadingZeros(List<string> commish)
{
List<string> lineList = new List<string>();
int count = 0;
foreach(string line in commish)
{
commish.ToString().TrimStart('0');
count++;
}
lineList.AddRange(commish);
return lineList.ToList();
}
Data set looks like this:0000012.74
-000001.3
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No worries Jim :)
ASKER