© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
21 replies
kaplumbanecdet

LINQ Help

bool IsSmooth(string input)
{
    var inputWords = input.Split();

    bool allCharsMatch = true;
    for (int i = 1; i < inputWords.Length; i++)
    {
        if (inputWords[i][0] != inputWords[i - 1].Last()) 
        {
            allCharsMatch = false;
            break;
        }
    }
    return allCharsMatch;
}
bool IsSmooth(string input)
{
    var inputWords = input.Split();

    bool allCharsMatch = true;
    for (int i = 1; i < inputWords.Length; i++)
    {
        if (inputWords[i][0] != inputWords[i - 1].Last()) 
        {
            allCharsMatch = false;
            break;
        }
    }
    return allCharsMatch;
}

How can I get the same functionality with LINQ, I tried looking it up but its usage of lambda functions confused me. Should I stick with this type of loops instead of LINQ and where can I learn LINQ, Microsoft's LINQ documentation is too complex for me. If I need to spend more time before I get into LINQ what should I accomplish / know?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

LINQ help
C#CC# / help
2y ago
Linq help
C#CC# / help
2y ago
❔ Linq Query HELP
C#CC# / help
3y ago
Ez LINQ Help
C#CC# / help
4y ago