Trim c#

  • Thread starter Thread starter Kusanagy9999
  • Start date Start date
K

Kusanagy9999

Guest
Hi

How can i solve this problem ? I want to get this output, what would be the code? Console.Write("Enter your first name: "); string firstName = Console.ReadLine(); Console.WriteLine($"Your firstName is: {firstName.Trim()}"); If someone types two names with spaces, how do I get output without spaces. Use Trim but it only works with one word, it doesn't work with two words with spaces

Continue reading...
 
Back
Top