如何检查数组中的所有字符串是否与长度相同C#
例如,
string[] text=new string[] {"string1", "string2", "string3"};
我怎么知道此数组中的所有字符串长度是否相等?
for instance,
string[] text=new string[] {"string1", "string2", "string3"};
how do i know if all string's length in this array are equal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
另一个解决方案:
Another solution:
这是一个解决方案,而无需使用
(每个)
:Here is a solution without using
for(each)
as requested:这是另一种解决方案,该解决方案不使用
(每个)
,并且不会尝试使用其他类型的循环(例如while
)来作弊:Here is another solution that does not use
for(each)
and does not try to cheat by using a different type of loop (likewhile
):最荒谬的递归使用?
Most ridiculous use of recursion?