/ Published in: C#
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public static string Left(string param, int length) { //we start at 0 since we want to get the characters starting from the //left and with the specified lenght and assign it to a variable string result = param.Substring(0, length); //return the result of the operation return result; } public static string Right(string param, int length) { //start at the index based on the lenght of the sting minus //the specified lenght and assign it a variable string result = param.Substring(param.Length - length, length); //return the result of the operation return result; }