Delete Last Letter - CSharp System

CSharp examples for System:String Shorten

Description

Delete Last Letter

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Security.Cryptography;
using System.Collections;
using System;/*ww  w .ja  va 2  s.  co  m*/

public class Main{
        public static string DeleteLastLetter(this string str)
        {
            if (str.Length < 2)
            {
                return str;
            }
            return str.Substring(0, str.Length - 1);
        }
}

Related Tutorials