string barcodes = string.Join(",",
result.data.Select(a =>
{
if (long.TryParse(a.BarcodeValue, out long num))
{
// Remove leading zeros by parsing, then ensure 13-digit format
return num.ToString().PadLeft(13, '0');
}
return a.BarcodeValue; // fallback if not purely numeric
})
);
Example:
Input → ["0507510108257", "0001234", "7890"]
Output →
Sign up here with your email
ConversionConversion EmoticonEmoticon