473,322 Members | 1,409 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,322 software developers and data experts.

Function to get text between to markes?

Hello guys,

I wonder if you know any function like this.

I function that can extract a string between to markers, for example: hey.my name is Raul.hello. And the markers here are the points ".".

The result string is "my name is Raul"

I know that I can do it with index of and using some auxiliar variables, even though I would like to do it in not too many steps.

What do you think?
May 8 '09 #1
3 1566
IanWright
179 100+
You can use either String.Split("My. Name is. Bob", ".");

Or you could try Regex.
May 8 '09 #2
balame2004
142 100+
Simple. Try this:

string str="hey.my name is Raul.hello";
str = str.Substring(str.IndexOf('.') + 1, str.LastIndexOf('.') - str.IndexOf('.')-1);
MessageBox.Show(str);
May 8 '09 #3
Thank you blame, it was very helpful.
May 8 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Kamran | last post by:
Hi I have very little experience of C++, nevertheless I have been asked to write a gui using QT/QWT. I know that I should direct the question to the relevant mailing list and I have done that but...
8
by: Abby Lee | last post by:
My function works but there has got to be a way to make a for loop to handle this...but I can't get a for loop to work. You can tell, I'm not very good at this...help. "myvalue" is the number of...
6
by: marcelf3 | last post by:
Hello.. This page opens a window with some information, but everytime the user changes a field in the parent window, the child window needs to be closed. These 2 functions were supposed to do the...
12
by: Susan Cranford | last post by:
Please forgive, I have looked at so much info I can't figure out how to put it together even though I know it must be fairly simple. I have an array of input text boxes (txtDOBn) where n is...
3
by: Thomas Matthews | last post by:
Hi, I've found with my compiler, that when a function contains const data in a function, that data is first copied to the stack. Given: /* Example 1 */ char Buffer; void My_Func(void)
9
by: Leon | last post by:
I have a webform in which when the user press generate button the form generate six unique ramdon numbers, the user can also type these six numbers in manually in any order. however, the user can...
7
by: GysAnn | last post by:
Hello, I'm looking for a function for converting the input to a regular text. Example: when the input is "aBCdefgHI jkLM ooPP" the return value of the function should be "Abcdefghi Jklm...
0
by: aolba | last post by:
Hello, I hope I could get some help with this issue, since I give up. It is too much for just me. This script is originally from MX. I have a hard time trying to translate to AS3. Anyway. There...
2
by: shivendravikramsingh | last post by:
hi friends, i m using a ajax function for retrieving some values from a database table,and display the values in required field,my prob is that the ajax function i m using is working f9 once,but if...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.