Welcome to weblogs.com.pk Sign in | Join | Help

C#: Left() and Right()

Missing Left() and Right() functions of VB6 in C#?

Here are these:

 

       public class Text

       {

              Text() {}

              static public string Left(string data, int length)

              {

                     return data.Length<length? data: data.Substring(0, length);

              }

              static public string Right(string data, int length)

              {

                     return data.Length<length? data: data.Substring(data.Length-length);

              }

       }

 

Published Monday, January 3, 2005 3:10 PM by khurram
Filed under:

Comments

No Comments

New Comments to this post are disabled