473,397 Members | 2,056 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.

Taking fields out of a string

Jac
Hey,
I have a string (an document.rtf loaded in a stream and then via
streamreader.ReadToEnd i filled the string)

Ex. of the string

" My name is &replacename& My address is &replaceadress& ... "

Now i want just to take out of the names between the & and i want to put
then in an arrary of strings.

Result would be : [replacename,replaceadress]

I looked at regex.split, but is not what i want really.
Are there some other matching rules or things I can do.

Thanks for help
jac
Nov 17 '05 #1
2 951
Hi !
Jac wrote:
[...snip...]
" My name is &replacename& My address is &replaceadress& ... "

Now i want just to take out of the names between the & and i want to put
then in an arrary of strings.

Result would be : [replacename,replaceadress]

I looked at regex.split, but is not what i want really.

[...snip...]

Try something like (not tested):

Regex express = new Regex("&.*?&");
MatchCollection matches = express.Matches(yourString);
Nov 17 '05 #2
try using:

string a = Regex.Replace(test, @"\W\&replacename\&\W", "Marinus Holkema");

"Jac" wrote:
Hey,
I have a string (an document.rtf loaded in a stream and then via
streamreader.ReadToEnd i filled the string)

Ex. of the string

" My name is &replacename& My address is &replaceadress& ... "

Now i want just to take out of the names between the & and i want to put
then in an arrary of strings.

Result would be : [replacename,replaceadress]

I looked at regex.split, but is not what i want really.
Are there some other matching rules or things I can do.

Thanks for help
jac

Nov 17 '05 #3

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

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
4
by: Melissa | last post by:
I have a frontend file named CustomerApp and backend file named CustomerData. CustomerApp is at C:\Customer Database and CustomerData is at S:\Customer Database. Could someone help me with the code...
1
by: Dixie | last post by:
I wish to add some fields to an existing table in code. I am using the following code from rkc. CurrentDb.Execute ("ALTER TABLE MyTable ADD MyNewField Text 25") This works , but I need to also set...
2
by: Brian Kitt | last post by:
I have a process where I do some minimal reformating on a TAB delimited document to prepare for DTS load. This process has been running fine, but I recently made a change. I have a Full Text...
3
by: JDiamond | last post by:
Hi, I have a table called Hosts. The Hosts table contains the following fields: Each field represents a step in the project. The tech that completes each step initials the respective...
5
by: CarrieR | last post by:
I am working within a DB I have been devolping in Access 2003, and have encountered a report coding issue I was hoping someone could help me with: I have 18 reports, each running off some smaller...
2
by: anon.asdf | last post by:
Hello! 1) =============================== When trying to define an array of std::string ... func( (std::string ) { std::string("ab"), std::string("cd"), std::string("ef") } , 3 ); ...
2
by: hutch75 | last post by:
Hi folks, I've been dead-ending on this issue, and I'm dusting off my brain to re-engage with Perl, so pls bear with me. Here's an example of what I'm trying to accomplish, have tried several...
4
by: crochunter | last post by:
Hi, I want to read values from a text files from specified fields and use them as values to fill my methods inside the paintComponent() method. I am using for loop to do that but not able to do it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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
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.