473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Right(string)

Is there a VB.NET function to find the right most characters of a string
similiar to Microsoft.VisualBasic.Right?

I am currently using the below code to find the right most characters and am
wondering if there is a more efficient or better way to do the same.

dim x as string
dime y as string
dim lastIndexof as stirng
x = New StringBuilder(WhereFunction)y = x.Length

lastIndexof = x.ToString.LastIndexOf(" ")

If y = lastIndexof Then

y = y

End If
Nov 18 '05 #1
3 2296
Right() still can be used, infact you don't even need to be using VB.net

Microsoft.VisualBasic.Right("blah", 2)

"Brian Shannon" <bs******@lbrspec.com> wrote in message news:eb*************@tk2msftngp13.phx.gbl...
Is there a VB.NET function to find the right most characters of a string
similiar to Microsoft.VisualBasic.Right?

I am currently using the below code to find the right most characters and am
wondering if there is a more efficient or better way to do the same.

dim x as string
dime y as string
dim lastIndexof as stirng
x = New StringBuilder(WhereFunction)y = x.Length

lastIndexof = x.ToString.LastIndexOf(" ")

If y = lastIndexof Then

y = y

End If

Nov 18 '05 #2
Thanks for the quick reply. I know that Microsoft.VisualBasic.Right can
still be used but I just assumed there is a more effecient way of doing it
with with the string functions or stringbuilder class.

Just curious if there is another way?

Thanks Raterus
"Raterus" <ra*****@spam.org> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
Right() still can be used, infact you don't even need to be using VB.net

Microsoft.VisualBasic.Right("blah", 2)

"Brian Shannon" <bs******@lbrspec.com> wrote in message
news:eb*************@tk2msftngp13.phx.gbl...
Is there a VB.NET function to find the right most characters of a string
similiar to Microsoft.VisualBasic.Right?

I am currently using the below code to find the right most characters and am wondering if there is a more efficient or better way to do the same.

dim x as string
dime y as string
dim lastIndexof as stirng
x = New StringBuilder(WhereFunction)y = x.Length

lastIndexof = x.ToString.LastIndexOf(" ")

If y = lastIndexof Then

y = y

End If

Nov 18 '05 #3
You can basically achieve the same effect using substring

Dim blah as string = "here is some string"
Dim newstring as string = blah.Substring(blah.Length - 5)

At this point newstring = "tring"
"Brian Shannon" <bs******@lbrspec.com> wrote in message news:uR**************@TK2MSFTNGP11.phx.gbl...
Thanks for the quick reply. I know that Microsoft.VisualBasic.Right can
still be used but I just assumed there is a more effecient way of doing it
with with the string functions or stringbuilder class.

Just curious if there is another way?

Thanks Raterus
"Raterus" <ra*****@spam.org> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
Right() still can be used, infact you don't even need to be using VB.net

Microsoft.VisualBasic.Right("blah", 2)

"Brian Shannon" <bs******@lbrspec.com> wrote in message
news:eb*************@tk2msftngp13.phx.gbl...
Is there a VB.NET function to find the right most characters of a string
similiar to Microsoft.VisualBasic.Right?

I am currently using the below code to find the right most characters and

am
wondering if there is a more efficient or better way to do the same.

dim x as string
dime y as string
dim lastIndexof as stirng
x = New StringBuilder(WhereFunction)y = x.Length

lastIndexof = x.ToString.LastIndexOf(" ")

If y = lastIndexof Then

y = y

End If


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: bart plessers | last post by:
Hi, I have a counter i Now I want to derive a fixed lenght string from this counter : 1 -> "00000001" 52 -> "00000052" 12896 -> "00012896" What is the fastest way to do this?...
3
by: Sam | last post by:
I want to divide character into 2 section. Example, 200412 divided into 2004 in A block and 12 in B block. Please advise how to use left(string, length) or right(string, length) for above...
3
by: moondaddy | last post by:
I looked at the string functions in .net and didnt see anything thats similar to the old vb6 Right string function. Is there another .net way to do this? Here's my suto code for what I'm trying...
3
by: Brett | last post by:
I've compiled a DLL which is being called from a different project. The following code is from the DLL. When I run the WriteToFile sub the second time from the spawning project, I get the error...
8
by: Harvey Triana | last post by:
Hello. By example, I have string with a "Hello There". I use Right("Hello There", 3) function in VB.NET to just get "ere" out of the string but there doesn't seem to be one in C#. I have two...
4
by: janssensglb | last post by:
I want to export from Access 2000 a numeric field (double) to a text file. The export file should be fixed length (no delimiters), the field should have 9 digits in total, including 2 decimals. I...
2
by: emo10001 | last post by:
Hey everyone, New here and fairly new to Access programming. I'm using Access 2003 in XP SP2 I've used this site before without having to ask a question but I'm really stuck :( I have a table...
7
by: cephal0n | last post by:
Hi there! I've been racking my brains out for 4 days and still not getting why is msaccess stubborn about string parsing, first I have a table named tblItems, this table has columns: ProductItem,...
2
by: ventos | last post by:
First of all, ive been trying to learn c++ for a couple of days ;) Problem i need to strip http links from string code: string replaceAll(string s, string f, string r) { unsigned int found...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.