and then find out which word is the longest, and copy that to the longestWord variable
using System;
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
string lyric = "We've come a long long way together";
string[] words;
string longestWord;
words = lyric.Split(' ');
longestWord = lyric;
Console.WriteLine("There are " + words.Length + " words, and the longest is " + longestWord);
}
}
}
namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
string lyric = "We've come a long long way together";
string[] words;
string longestWord;
words = lyric.Split(' ');
longestWord = lyric;
Console.WriteLine("There are " + words.Length + " words, and the longest is " + longestWord);
}
}
}
Vincent Maverick DuranoPosted Dec 17, 2018, 6:26 PM