C# 字符串中包含数字的字符数

C# Number of characters in string with numbers

我有 字符串列表 - 带有数值 (10,20...) 的 sList,我想找出它的数量 -> 10 returns 2.

我尝试了 sList[i].Length 但没有成功。

如果列表是字符串列表,那么 .Length 应该可以。否则你可以试试这个。

sList[i].ToString().Length