这个程序没有按预期工作,我不知道为什么。错误是CS0266 "
Error CS0266 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<char>' to 'string'. An explicit conversion exists (are you missing a cast?)
但是,它应该在使用 System.Linq 下正常工作;
using System;
using System.Linq;
namespace centuryyearsminutes
{
class Program
{
static void Main(string[] args)
{
string aa = "Hello World!";
string bb = aa.Reverse();
Console.WriteLine(bb);
}
}
}
Run Code Online (Sandbox Code Playgroud) 我试图理解,但这不是输出@!如果是 bool ,则不能签名为 int,但如果是 int ,则不能签名为 bool。TryParse 成功后如何获取和使用数值?谢谢。
using System;
namespace TryParse
{
class Program
{
static void Main(string[] args)
{
string input = Console.ReadLine();
bool s;
int a = int.TryParse(input, out @@@ WHAT ???? );
}
}
}
Run Code Online (Sandbox Code Playgroud) c# ×2