c# - 只有assignment、call、increment、decrement、await和new对象表达式可以用作语句[c#]
问题描述
string userTweet = Console.ReadLine();
userTweet.Length; // returns the length of the password
当我使用 Length 方法时,我遇到了以下问题
“只有赋值、调用、递增、递减、等待和新对象表达式可以用作语句[c#]”
解决方案
将值写入控制台怎么样?
Console.Writeline(userTweet.Length);
推荐阅读
- c# - 如何在 C# 中为我的结构重载 Double.Equals()?
- python - 为什么 VS Code + Anaconda 在 Windows 上这么慢
- webview - python 龙卷风网络服务器 + pywebview
- vb.net - 如何将一个程序输入到另一个程序中
- r - 将 ts 对象转换为 data.frame 并保留行名和列名
- c++ - 在客户端和服务器之间序列化复杂的 C++ 结构
- html - 使用“data-*”属性替换 HTML 标记中的“id”属性以用于 CSS 选择目的
- python - 在 Python 中的 if 语句中分组条件的正确语法是什么?
- javascript - 在 Android Xamarin CrossWalk Webview 中从 Javascript 调用 C# 函数
- assembly - YASM:指令 movsx 拒绝操作数大小的 dword?