string barcodes = string.Join(",",
result.data.Select(a =>
{
if (long.TryParse(a.BarcodeValue, out long num))
return num.ToString(); // removes leading zeros
return a.BarcodeValue; // fallback if not numeric
})
);
Console.WriteLine(barcodes);
will convert
"0507510108257", "0001234", "7890"
"507510108257,1234,7890"
Sign up here with your email
ConversionConversion EmoticonEmoticon