473,499 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

character selection in a string

I have the following type of data sitting in a varaible

Just Buttons+butto

The text and lenght can change, however, no matter what the length is I would like to strip off the "+" sign and everything to the right of it and place it into another (or the same) variable. What is the easiest way to accomplish this

Thank you
John
Nov 20 '05 #1
3 1057
"jcrouse" <an*******@discussions.microsoft.com> schrieb
I have the following type of data sitting in a varaible:

Just Buttons+button

The text and lenght can change, however, no matter what the length is
I would like to strip off the "+" sign and everything to the right of
it and place it into another (or the same) variable. What is the
easiest way to accomplish this?


Dim s As String

s = "Just Buttons+button"

s = s.Split("+"c)(0)
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
Nov 20 '05 #2
John,
In addition to Armin's suggestion:

Dim s As String

s = "Just Buttons+button"

s = s.SubString(0, s.IndexOf("+"c)

I suspect there are probably 2 or 3 other methods you could use ;-)

Hope this helps
Jay
"jcrouse" <an*******@discussions.microsoft.com> wrote in message
news:70**********************************@microsof t.com...
I have the following type of data sitting in a varaible:

Just Buttons+button

The text and lenght can change, however, no matter what the length is I would like to strip off the "+" sign and everything to the right of it and
place it into another (or the same) variable. What is the easiest way to
accomplish this?
Thank you,
John

Nov 20 '05 #3
HI Jay,
I suspect there are probably 2 or 3 other methods you could use ;-)


It was for me a challenge and I can give of course a VB left function,
however the one you gave is the best in my opinion and therefore I will not
bring the OP in problems by giving him another one.

:-)

No need answering.

Cor
Nov 20 '05 #4

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

Similar topics

3
6662
by: Noah | last post by:
I have a text field in a form. I want the user to be able to click a DELETE button and have the character at the cursor position deleted. This would be just as if the user had pressed the Back...
9
8132
by: Safalra | last post by:
The idea here is relatively simple: a java program (I'm using JDK1.4 if that makes a difference) that loads an HTML file, removes invalid characters (or replaces them in the case of common ones...
5
2315
by: jen_designs | last post by:
Is there a way to return the character position on a page? Not the x and y coordinates, but the number of characters on a page. For instance i have a html page with the following text: This is my...
37
10115
by: chandy | last post by:
Hi, I have an Html document that declares that it uses the utf-8 character set. As this document is editable via a web interface I need to make sure than high-ascii characters that may be...
1
1959
by: Steve | last post by:
I have a continuous form with several unbound comboboxes in the form header. The comboboxes are used to provide criteria for the SQL of the form. The code behind the form looks like: Public Sub...
0
1153
by: Lau Lei Cheong | last post by:
Hello, I'm writing a project that involves entering chinese character into MySQL database. Since 1) connection-based coding selection requires an upgrade to version 4.1.1 or above and my...
5
12831
by: STeve | last post by:
Hey guys, I currently have a 100 page word document filled with various "articles". These articles are delimited by the Style of the text (IE. Heading 1 for the various titles) These articles...
7
3664
by: tatata9999 | last post by:
Hi, SQL env: sql server 2000 Target column of insertion: varchar(15) Case, a var is made up of a character of the following characters (random selection):...
7
14454
by: robtyketto | last post by:
Greetings, I'm slowly building up code to do the following:- Display TWO selection option boxes (cascading). If the FIRST selection option box changes then reload the jsp using onchange...
1
2413
by: =?Utf-8?B?TGkgUWl1?= | last post by:
Hi, I am trying to get the inserting position of a string within a DataGridViewTextBoxCell in editing mode, based on the cursor point position in selection mode. I used the method...
0
7171
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
7220
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...
1
6893
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
7386
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
5468
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,...
1
4918
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...
0
4599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.