Juan Jose Garcia Juan Jose Garcia - 1 month ago 11
C# Question

How to trim after 1 letter from space C#?

Hello I'm trying to take out the first word and the first from the second and with no blank space from a string but I got no success. How can I do it?

Example:
I have the words: HELLO WORLD! and I want to get: HELLOW
Or: LAPTOP COVER and get LAPTOPC

There's no limit of letters for the first word. Thank you all!

Answer
 string s = "HELLO WORLD!";
 string[] s1 = s.Split(' ');
 string outchar = s1[0] + s1[1].Substring(0, 1);