Skip to main content
added 1 character in body
Source Link
Caridorc
  • 27.6k
  • 7
  • 54
  • 135

This kind of task is well suited to Linq and functional programming, imperative code will only reinvent basic algorithms, so following @Topin suggestion, I suggest this outline:

public static string[] words(string text) 
{
    // Use of Regex and SpltSplit
}

public static string longestWord(string text)
{
    // Make use of words and OrderBy
}

This kind of task is well suited to Linq and functional programming, imperative code will only reinvent basic algorithms, so following @Topin suggestion, I suggest this outline:

public static string[] words(string text) 
{
    // Use of Regex and Splt
}

public static string longestWord(string text)
{
    // Make use of words and OrderBy
}

This kind of task is well suited to Linq and functional programming, imperative code will only reinvent basic algorithms, so following @Topin suggestion, I suggest this outline:

public static string[] words(string text) 
{
    // Use of Regex and Split
}

public static string longestWord(string text)
{
    // Make use of words and OrderBy
}
Source Link
Caridorc
  • 27.6k
  • 7
  • 54
  • 135

This kind of task is well suited to Linq and functional programming, imperative code will only reinvent basic algorithms, so following @Topin suggestion, I suggest this outline:

public static string[] words(string text) 
{
    // Use of Regex and Splt
}

public static string longestWord(string text)
{
    // Make use of words and OrderBy
}