Click here to Skip to main content
15,912,504 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi!
i want to create a program in c# console. that takes 5 input from the user in the given format: A 2 1
B 3 3
A 1 3
A 4 2
B 2 2
i want to add all the mid numbers of input but i am confuse how to do it. please tell me how to do it.
thanks in advance
Posted
Updated 18-Mar-12 18:27pm
v2
Comments
Sergey Alexandrovich Kryukov 18-Mar-12 23:46pm    
Not a question. What's the problem?
--SA
saifullahiit 18-Mar-12 23:55pm    
just check the question again, at the end i have mentioned that i dont know how to add the all middle numbers.
Sergey Alexandrovich Kryukov 19-Mar-12 0:54am    
Do you think "I don't know" is a question? :-)
--SA
Sergey Alexandrovich Kryukov 19-Mar-12 0:54am    
OK, and what is "middle numbers"?
--SA

1 solution

if any line is a string you can do that
string line = "a 1 2";
string[] splitedLine = line.Split(' ');
string part = splitedLine[1];
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900