DEV Community

Discussion on: Daily Challenge #1 - String Peeler

Collapse
 
bugmagnet profile image
Bruce Axtens

I've only just stumbled over the Daily Challenge. Oh well, here's my C# Linq solution (different from the other one) and returns an empty string if length <= 2.

public static string StringPeeler(string str) => string.Join("", from ch in str.ToCharArray(1, str.Length - 2) select ch);