63 135
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #11135 in C# for vikash kumar rai

Question #11135
write a c# program which will accept a text from user and remove the extra spaces within there
Expert's answer
using System;
using System.Collections.Generic;
using
System.Linq;
using System.Text;

namespace Question11135
{

class Program
{
static void Main(string[] args)

{
string inputstr = "";
string outputstr =
"";
inputstr = Console.ReadLine();
for (int i = 0;
i < inputstr.Length; i++) {
if (inputstr[i] != ' ')
{
outputstr += inputstr[i];

}
}
Console.Write(outputstr);

Console.ReadLine();
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions