본문으로 건너뛰기

[Codewars #56] Remove First and Last Character (8kyu)

· 약 1분
karais89

Instructions

링크

It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the original string. You don't have to worry with strings with less than two characters.

My Solution

using System;

public class Kata
{
public static string Remove_char(string s)
{
// Your Code
return s.Substring(1, s.Length - 2);
}
}

Best Practices

using System;

public class Kata
{
public static string Remove_char(string s)
{
return s.Substring(1,(s.Length - 2));
}
}
  • 똑같은 방식으로 해결