473,503 Members | 9,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Grab data from string

Hi,

I have a string with a lot of text. I want to filter out some data. I know
some characters before and after the wanted data.

I know that there is a substring method but this one use a fixed length, a
length I don't know.

How can I retriew the middle data, having a string before and after that
data?

Thanks!
Arjen
Apr 20 '07 #1
4 1408
Sounds like a regex to me... google for regex if you aren't familiar

Marc
Apr 20 '07 #2
Arjen wrote:
Hi,

I have a string with a lot of text. I want to filter out some data. I
know some characters before and after the wanted data.

I know that there is a substring method but this one use a fixed
length, a length I don't know.

How can I retriew the middle data, having a string before and after
that data?
Using regular expressions (which are directly supported by the .NET
framework) might do the trick. It does depend on the nature of your data,
though.

Ebbe
Apr 20 '07 #3
If you know the chars before and after then use indexof to identify where in
your string the identifiable bits are - and just pull out the middle using
substring and the values indexof provided.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"Arjen" <bo*****@hotmail.comwrote in message
news:f0**********@news1.zwoll1.ov.home.nl...
Hi,

I have a string with a lot of text. I want to filter out some data. I know
some characters before and after the wanted data.

I know that there is a substring method but this one use a fixed length, a
length I don't know.

How can I retriew the middle data, having a string before and after that
data?

Thanks!
Arjen

Apr 20 '07 #4
Thanks!

Arjen
"John Timney (MVP)" <x_****@timney.eclipse.co.ukschreef in bericht
news:_J******************************@eclipse.net. uk...
If you know the chars before and after then use indexof to identify where
in your string the identifiable bits are - and just pull out the middle
using substring and the values indexof provided.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
"Arjen" <bo*****@hotmail.comwrote in message
news:f0**********@news1.zwoll1.ov.home.nl...
>Hi,

I have a string with a lot of text. I want to filter out some data. I
know some characters before and after the wanted data.

I know that there is a substring method but this one use a fixed length,
a length I don't know.

How can I retriew the middle data, having a string before and after that
data?

Thanks!
Arjen


Apr 20 '07 #5

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

Similar topics

0
2707
by: Baby Blue | last post by:
I have 2 code like below to grab a news website for my site. However, when I click some links (such as : http://wwww.vnexpress.net/xxx/xxxx ) inside the site which I want to grab, it has some...
8
3427
by: gregory_may | last post by:
Is there a way to grab a "Screen Shot" that includes "Tool Tips"? I saw this code someplace, cant remember where. But it doesnt grab "Tool Tips". Is there a better way to do this in .net?...
3
1357
by: Andy Kasotia | last post by:
On the client once the user clicks the Submit button....in my code the following javascript function kicks off... onclick="return SubmitForm('frmCurrBuildings', 'CurrBuildings.asp', c_iLOADNEW,...
10
1415
by: Jonathan Schwarz via DotNetMonster.com | last post by:
Hi folks, I am a complete newbie to ASP.NET, VB, etc... I am coming from a Cold Fusion background where it only takes me 4 lines to query a MSSQL db and display a field name. Please, how do I...
4
5557
by: Ken Swanson | last post by:
Hi, In VB.NET, how do I determine what filename has been dropped into a ListView? In my ListView's DragEnter() event, I am trying this, which according to the Help, should work: MyFilename...
5
1272
by: darrel | last post by:
I'm having a really odd problem that I can't find many other examples of. I'm using XMLTextWriter and grabbing data from a database and then spitting out an RSS-compliant XML file. The problem...
4
1351
by: Prodian | last post by:
Im trying to parse a recv from a telnet session then only grab certain data. Heres an example of the recv that Im storing into a string: Internet 204.189.124.205 0 001a.a01f.4e5a ...
19
1850
by: JRough | last post by:
I have used this function to create a string called $headers: function GetHeaders($file_name){ return "<th><a href='".$file_name."&order_by=l_e'>L_E</a></th> <th><a href='"....
0
7207
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
7095
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
7361
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
7470
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
5602
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
5026
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
3183
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.