Answer the question
In order to leave comments, you need to log in
How to create a method in C#?
string GETT(string Url)
{
return (url + "world");
}
return GETT("hi");
I'm trying to understand the correct creation of methods and their invocation.
What is missing dear?
I can't find an example anywhere to insert it into LINQPad 4 - and it works.
There are some mistakes everywhere.
Answer the question
In order to leave comments, you need to log in
First: I would recommend sticking to the naming conventions.
Secondly, please note that the Url argument is capitalized, and in the method itself you wrote it incorrectly. C# is a case sensitive language.
string Gett(string url) // ошибка с регистром была тут
{
return (url + "world");
}
string Gett(string url)
{
return (url + "world");
}
Gett("hi"); //вызывайте этот метод в функции Main
string Gett(string url)
{
return (url + "world");
}
string SaySomething(string something)
{
return Gett(something);
}
SaySomething("hi"); // вызывайте этот метод в Main
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question