If your purpose is to read from
Console
and return the input as a
string
, then the
Read
method in
IPerl
interface may be made to return a
string
and other modifications may be made as follows:
using System;
namespace ReadFromConsole {
class Program {
static void Main(string[] args) {
IPerl perl = new Test();
Console.WriteLine (perl.Read());
Console.ReadKey();
}
}
public class Test : IPerl {
public string Read() {
var conkeyinfo = Console.ReadLine();
return conkeyinfo.ToString();
}
}
public interface IPerl {
string Read();
}
}