VB5 / VB6
Function Challenge1(input As String) As String If len(input) <= 2 Then Challenge1 = Nothing Else Challenge1 = Mid$(input, 2, len(input) - 2) End If End Function
Visual Basic .NET
Function Challenge1(input as String) Return If(input.Length > 2, Mid(input, 2, len(input) - 2), Nothing) End Function
C#
string Challenge1(string input) => input.Length > 2 ? input.Substring(1, input.Length - 2) : null;
C# using LINQ (because yes)
string Challenge1(string input) => input.Length > 2 ? string.Concat(input.Skip(1).Take(input.Length - 2)) : null;
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
VB5 / VB6
Visual Basic .NET
C#
C# using LINQ (because yes)