Longest Word in Beef

Published on 22 January 2024 (Updated: 22 January 2024)

Welcome to the Longest Word in Beef page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

using System;

namespace LongestWord;

class Program
{
    public static void Usage()
    {
        Console.WriteLine("Usage: please provide a string");
        Environment.Exit(0);
    }

    public static int LongestWord(StringView str)
    {
        int maxLen = 0;
        for (StringView word in str.Split(' ', '\t', '\r', '\n'))
        {
            maxLen = Math.Max<int>(maxLen, word.Length);
        }

        return maxLen;
    }

    public static int Main(String[] args)
    {
        if (args.Count < 1 || args[0].Length < 1)
        {
            Usage();
        }

        int result = LongestWord(args[0]);
        Console.WriteLine(result);
        return 0;
    }
}

Longest Word in Beef was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.