I
I
Ivan2014-10-27 11:41:42
Parsing
Ivan, 2014-10-27 11:41:42

C# - Creating a method that returns a value of type int?

Let's say I have a method in whose parameters you can only write a string and this method calculates the number of characters ("-") in this string, but how to do it so that

//...там же этот метод скажем scanner
static void Main()
        {
string ty = Console.ReadLine();
int razd = scanner(ty);
 
}

Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Sydorenko, 2014-10-27
@tibExel

Are you talking about this??

int sanner(string str)
{
return str.Length;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question