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

Extracting string

Hi

I have a string with two $ sign in between, like ab$cdefg$eurur. I need to
extract the right most part of the string from just right of the $ sign. How
do I do this?

Thanks

Regards
Jul 10 '06 #1
7 1031
Try this:

Dim str As String = "ab$cdefg$eurur"
str = str.Substring(0, str.IndexOf("$", 0))

On Mon, 10 Jul 2006 19:16:53 +0100, John <Jo**@nospam.infovis.co.ukwrote:
Hi

I have a string with two $ sign in between, like ab$cdefg$eurur. I need
to
extract the right most part of the string from just right of the $ sign.
How
do I do this?

Thanks

Regards



--
Tiago Salgado
http://www.foruns.org
Jul 10 '06 #2
You may use the Split Method that will split the string based on the
character passed (in this case $)
It returns an array of string and you may choose the string that you like
(The string to the right of the right $ will have index 2 of the array)

hth,
Samuel Shulman


"John" <Jo**@nospam.infovis.co.ukwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi

I have a string with two $ sign in between, like ab$cdefg$eurur. I need to
extract the right most part of the string from just right of the $ sign.
How do I do this?

Thanks

Regards

Jul 10 '06 #3
John wrote:
I have a string with two $ sign in between, like ab$cdefg$eurur. I
need to extract the right most part of the string from just right of
the $ sign. How do I do this?
\\\

Dim s1 As String = "ab$cdefg$eurur"
Dim s2 As String

s2 = Mid(s1, InStrRev(s1, "$") + 1)
///

--

(O)enone
Jul 10 '06 #4
Oenone wrote:
John wrote:
>I have a string with two $ sign in between, like ab$cdefg$eurur. I
need to extract the right most part of the string from just right of
the $ sign. How do I do this?

\\\

Dim s1 As String = "ab$cdefg$eurur"
Dim s2 As String

s2 = Mid(s1, InStrRev(s1, "$") + 1)
///
Dim s1 As String = "ab$cdefg$eurur"
Dim temp() as string = s1.split("$")
Dim result as string = temp(2)
Jul 10 '06 #5
This will get the characters(eurur) after the last $ or return all if there
are no $'s.

Dim str As String = "ab$cdefg$eurur"
str = str.Substring(str.LastIndexOf("$")+1)
--
Dennis in Houston
"John" wrote:
Hi

I have a string with two $ sign in between, like ab$cdefg$eurur. I need to
extract the right most part of the string from just right of the $ sign. How
do I do this?

Thanks

Regards
Jul 10 '06 #6
John wrote:
I have a string with two $ sign in between, like ab$cdefg$eurur. I need to
extract the right most part of the string from just right of the $ sign. How
do I do this?
Besides all the other suggestions, you may have also:

Dim S1 As String = "ab$cdefg$eurur"
Dim S2 As String = S1.Substring(S1.LastIndexOf("$"c) + 1)

Regards,

Branco.

Jul 10 '06 #7

John wrote:
Hi

I have a string with two $ sign in between, like ab$cdefg$eurur. I need to
extract the right most part of the string from just right of the $ sign. How
do I do this?
Lots of answers, and it's great to see that no one offered a regex!
Perhaps our efforts here in the newsgroups are not all in vain...

--
Larry Lard
Replies to group please
When starting a new topic, please mention which version of VB/C# you
are using

Jul 11 '06 #8

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

Similar topics

4
by: lecichy | last post by:
Hello Heres the situation: I got a file with lines like: name:second_name:somenumber:otherinfo etc with different values between colons ( just like passwd file) What I want is to extract...
2
by: Sammy | last post by:
Subject line says it all really. I have a 4 character long string, that contains a 32bit integer. Problem is i have no idea how i go about extracting it. Any help will be appreciated.
2
by: Steve | last post by:
Hi, I have a very long string, someting like: DISPLAY=localhost:0.0,FORT_BUFFERED=true, F_ERROPT1=271\,271\,2\,1\,2\,2\,2\,2,G03BASIS=/opt/g03b05/g03/basis,...
2
by: Dickyb | last post by:
Extracting an Icon and Placing It On The Desktop (C# Language) I constructed a suite of programs in C++ several years ago that handle my financial portfolio, and now I have converted them to...
13
by: Randy | last post by:
Is there any way to do this? I've tried tellg() followed by seekg(), inserting the stream buffer to an ostringstream (ala os << is.rdbuf()), read(), and having no luck. The problem is, all of...
7
by: Tempo | last post by:
Hello. I am having a little trouble extracting text from a string. The string that I am dealing with is pasted below, and I want to extract the prices that are contained in the string below. Thanks...
2
by: VictorTan | last post by:
Hello. I'm new to this forum. Hope that I don't make mistakes in here but if I do, please correct me if there is. Thanks. I also wanted to ask you guys regarding about the following following...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
4
by: dexter48 | last post by:
Hi I'm searching for a string occurance in a text file. I find the string ok and write the results to a log file. But on the line above is also some information I need. How can i get that. The string...
5
by: Mukesh | last post by:
Hi, I am using framework 2.0. I am writing a foreach loop that will extract single dimensional arrays out of double dimensional array. I am trying writing something like this. string ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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,...

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.