我想知道是否有人知道如何查看字符串中的每个字符,然后将每个字符添加到新字符串中?这只是一个非常非常基本的例子,我可以添加ToUpper
和ToLower
验证等等。
发布于 2012-04-08 06:23:37
var output = ""; // or use StringBuilder
foreach(char c in text)
{
output += c; // if or do with c what you need
}
...is这就是你需要的吗?
字符串为IEnumerable<char>
https://stackoverflow.com/questions/10058854
复制相似问题