首页 > 解决方案 > 只有assignment、call、increment、decrement、await和new对象表达式可以用作语句[c#]

问题描述

string userTweet = Console.ReadLine();
userTweet.Length; // returns the length of the password

当我使用 Length 方法时,我遇到了以下问题

“只有赋值、调用、递增、递减、等待和新对象表达式可以用作语句[c#]”

标签: c#

解决方案


将值写入控制台怎么样?

Console.Writeline(userTweet.Length);


推荐阅读