Link to home
Start Free TrialLog in
Avatar of waddhah
waddhah

asked on

What the opposite Function to MID()

Mid(text,2) will select the first 2 characters ,, I want to select the last characters
Avatar of isproca
isproca

Hi waddhah,

AnyString = "Hello World"

MyStr = Right(AnyString, 6)    ' Returns " World".

Heres the msdn link

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/ca808da5-85e2-49c3-8abe-d66f2dc92f9d.asp
Hope this helps


Cheers!
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of waddhah

ASKER

isproca,
 
Thanks for helping , but there is no such a function call Right in vb.net .
Avatar of waddhah

ASKER

thanks .
hi waddhah;


To do it like isproca posted you will have to import Microsoft.VisualBasic or write it this way

      MyStr = Microsoft.VisualBasic.Right(AnyString, 6)   ' Returns " World".

To to it the .Net way, do it like this

      Dim LastToChars As String = AnyString.Substring(AnyString.Length - 6) ' Returns world
      Where - 6 is how many character to select

Fernando

     
waddhah,
Sorry, I didnt see the .NET I just saw VB.  My appologies!!