Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB.net Equivalent to VB6 Right

Status
Not open for further replies.

llmclaughlin

Programmer
Aug 20, 2004
140
US
If vb6 you would use acctNumber = Right$(Dfi_Account_Number, 4)
Which give you tha last four of number, how this done in .net.


Thanks


Louie
 
You could use the Substring method, or you could continue to use Right.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
And a simple example:

Dim a As String = "asdfg1234"
MsgBox(a.Substring(a.Length - 4))
 
As already pointed out you can continue to use Right. But to use it you will need to import the Microsoft.VisualBasic namespace.
Code:
Imports Microsoft.VisualBasic
Dim x As String = "1234567890"
Dim x1 As String = Right(x, 4)


Sweep
...if it works dont f*** with it
curse.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top