sql right function equivalent in c#
  • how can i get last 3 character from string as we use right function in sql.
  • 3 Comments sorted by
  • Vote Up0Vote Down Jaguar777Jaguar777
    51.00 Karma Accepted Answer
    Write this code 
        public static string Right(this string value, int length)
            {
                if (String.IsNullOrEmpty(value)) return string.Empty;

                return value.Length <= length ? value : value.Substring(value.Length - length);
            }
  • thanks @jaguar777 
    its working perfectly.
  • You are welcome

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Tagged

Popular Posts of the Week

    Optimum Creative