Get Right String - CSharp System

CSharp examples for System:String Start End

Description

Get Right String

Demo Code


using System.Text.RegularExpressions;
using System.Text;
using System.Reflection;
using System.Linq;
using System.Collections.Generic;
using System;/*from w w w .j  a  v  a  2 s.  com*/

public class Main{
        public static string GetRightString(string description, int rightLength)
        {
            if (!IsEmpty(description) && (description.Length > rightLength))
            {
                return description.Substring(description.Length - rightLength);
            }
            return description;
        }
}

Related Tutorials