[英]Count the characters in a cookie string using c#
Count the characters in a cookie string using c#使用 c# 计算 cookie 字符串中的字符数
I have a string as follows:我有一个字符串如下:
string str1 = Request.Cookies["GE"].Value;
This string could be:这个字符串可以是:
string str1 = "A";
or或者
string str1 = "AA";
or或者
string str1 = "AABB";
Using C#, I need to display the count of character as follows:使用 C#,我需要按如下方式显示字符数:
string str1 = "A"; ===> One
string str1 = "AA"; ===> Two
string str1 = "AABB"; ===> Four
Thanks in advance.提前致谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.