Click here to Skip to main content
15,891,513 members
Home / Discussions / C#
   

C#

 
AnswerRe: extracting sustrings from a string and store it in an array Pin
Alan Balkany16-Sep-08 4:04
Alan Balkany16-Sep-08 4:04 
AnswerRe: extracting sustrings from a string and store it in an array Pin
DaveyM6916-Sep-08 4:13
professionalDaveyM6916-Sep-08 4:13 
AnswerRe: extracting sustrings from a string and store it in an array [modified] Pin
#realJSOP16-Sep-08 4:15
mve#realJSOP16-Sep-08 4:15 
GeneralRe: extracting sustrings from a string and store it in an array Pin
wajans16-Sep-08 19:43
wajans16-Sep-08 19:43 
AnswerRe: extracting sustrings from a string and store it in an array Pin
PIEBALDconsult16-Sep-08 4:24
mvePIEBALDconsult16-Sep-08 4:24 
AnswerRe: extracting sustrings from a string and store it in an array [modified] Pin
Guffa16-Sep-08 6:12
Guffa16-Sep-08 6:12 
GeneralRe: extracting sustrings from a string and store it in an array Pin
wajans16-Sep-08 19:31
wajans16-Sep-08 19:31 
AnswerRe: extracting sustrings from a string and store it in an array Pin
wajans16-Sep-08 20:22
wajans16-Sep-08 20:22 
Hi
After doing r&d on regular expressions I got this answer.
If we want to extract a word from a string like "[something]" We could use the Match method in the regular expression.

Like this:

string s = "<p>[!vDescription][!vDate]</p><p>[!vTitle]</p>";
Regex rx = new Regex(@"\[.*?\]");
Match mc = rx.Match(s);
while(mc.Success)
{
Response.Write(mc.Value.ToString());
mc = mc.NextMatch();
}
Thanks
GeneralRe: extracting sustrings from a string and store it in an array Pin
Guffa16-Sep-08 21:45
Guffa16-Sep-08 21:45 
GeneralRe: extracting sustrings from a string and store it in an array Pin
wajans18-Sep-08 20:55
wajans18-Sep-08 20:55 
GeneralRe: extracting sustrings from a string and store it in an array Pin
Guffa18-Sep-08 22:43
Guffa18-Sep-08 22:43 
AnswerRe: extracting sustrings from a string and store it in an array [modified] Pin
wajans18-Sep-08 23:48
wajans18-Sep-08 23:48 
GeneralRe: extracting sustrings from a string and store it in an array Pin
egenis16-Sep-08 20:29
egenis16-Sep-08 20:29 
QuestionHow to add rows into Datatable? Pin
zeeShan anSari16-Sep-08 3:34
zeeShan anSari16-Sep-08 3:34 
AnswerRe: How to add rows into Datatable? Pin
Harvey Saayman16-Sep-08 3:45
Harvey Saayman16-Sep-08 3:45 
GeneralRe: How to add rows into Datatable? Pin
zeeShan anSari16-Sep-08 3:59
zeeShan anSari16-Sep-08 3:59 
GeneralRe: How to add rows into Datatable? Pin
Harvey Saayman16-Sep-08 4:04
Harvey Saayman16-Sep-08 4:04 
GeneralRe: How to add rows into Datatable? Pin
zeeShan anSari16-Sep-08 4:06
zeeShan anSari16-Sep-08 4:06 
GeneralRe: How to add rows into Datatable? Pin
zeeShan anSari16-Sep-08 4:06
zeeShan anSari16-Sep-08 4:06 
GeneralRe: How to add rows into Datatable? Pin
Harvey Saayman16-Sep-08 4:11
Harvey Saayman16-Sep-08 4:11 
GeneralRe: How to add rows into Datatable? Pin
zeeShan anSari16-Sep-08 4:16
zeeShan anSari16-Sep-08 4:16 
QuestionCombobox SelectedIndexchanged -ASP Pin
omlac16-Sep-08 3:18
omlac16-Sep-08 3:18 
AnswerRe: Combobox SelectedIndexchanged -ASP Pin
MeContra16-Sep-08 3:35
MeContra16-Sep-08 3:35 
GeneralRe: Combobox SelectedIndexchanged -ASP Pin
omlac16-Sep-08 3:46
omlac16-Sep-08 3:46 
QuestionDate time Sql and query Pin
Bongiwe16-Sep-08 3:10
Bongiwe16-Sep-08 3:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.