473,397 Members | 2,099 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,397 software developers and data experts.

VB.Net Counterpart to RIGHT$ and LEFT$ vb6 functions???

Could someone tell me what the VB.Net counterparts are to the commands
in VB6 which used to allow me to return only the rightmost or leftmost
parts of a string?

Thanks in advance.
Oct 9 '07 #1
2 5375
For Left, a fairly direct use of the string SubString method will do.
e.g., Left(y, 2) becomes y.Substring(0, 2)
For Right, it's only slightly more complex.
e.g., Right(y, 2) becomes y.Substring(y.Length - 2)
--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
C++ to C++/CLI
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB or C# to C++/CLI
"Alan Mailer" wrote:
Could someone tell me what the VB.Net counterparts are to the commands
in VB6 which used to allow me to return only the rightmost or leftmost
parts of a string?

Thanks in advance.
Oct 9 '07 #2
Alan Mailer wrote:
Could someone tell me what the VB.Net counterparts are to the commands
in VB6 which used to allow me to return only the rightmost or leftmost
parts of a string?
If you use
Imports VB=Microsoft.VisualBasic

then you can use VB.Left() and VB.Right() on strings.

The VB=... makes VB an alias of Microsoft.VisualBasic so you don't have to
keep typing it.

If you use String.Substring from the .NET framework then you should check if
the string is not Nothing first, and that you aren't trying to get a
substring that is outside the ends of the string.

Andrew
Oct 10 '07 #3

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

Similar topics

7
by: Wayne Wengert | last post by:
I use statements like LEFT(textstring,6) in my app. I have "Imports Microsoft.VisualBasic" at the top of the code but to use LEFT I have to code : Microsoft.VisualBasic.Left(sting, integer) If...
1
by: Luis | last post by:
can you look at my code, and tell my wy the section of the client program which says : const Fraction f3(12, 8); const Fraction f4(202, 303); result = f3.MultipliedBy(f4); cout << "The product...
6
by: Gary Morris | last post by:
Hi all, I tried posting this through a free news server, but it still has not appeared in Google, so if it turns up again I apologize. I hope someone can help me with this, or at least help...
6
by: Andrew | last post by:
Hi, friends, In VB, there is a vbCrLf for a new line. What is the counterpart in C#? Thanks.
59
by: Mr. x | last post by:
Hello, I need a good help/tutorial for VB, please (I preffer *.chm help file). Also : for the function : now() in VBScript for getting the current time, what is the counterpart function of VB ?...
0
by: McGragger | last post by:
I would really like to know how to make a time_t to_time_t(ptime) function. I am trying to do it with time_t and mktime functions but I am running into many issues with timezones and...
14
by: v4vijayakumar | last post by:
Why we need "virtual private member functions"? Why it is not an (compile time) error?
4
by: Han | last post by:
Hello I am passing string from dotnet to javascript. ", ', newline characters, and something. So I am using httputility.urlEncode() to make it neat. Now a JS function accepts the encoded string...
5
ADezii
by: ADezii | last post by:
Periodically, the same or similar question appears in our Access Forum: How can I use Excel Functions within Access? For this reason, I decided to make this Subject TheScripts Tip of the Week. In...
5
by: James | last post by:
Hello. I have a problem trying to get seperate image functions to work together. Starting with the img tag and associated html: <img src="image1.jpg" NAME="theImage" pbsrc="image1_lrg.jpg"...
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: 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:
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.