Ok, here is the issue.
I have a xyz.css file which I read using the streamreader. the file has text in the form .Addfont { ...... .GridLayout {...... a.Master Layout {...... Now I need to extract the text between the '.' and '{' In this case it would be Addfont GridLayout Master Layout How should I go about this.... I tried using the readline() method but it didn't work for the '{' Please help me Thank you |
|
(Rate)
|
![]() |
Extract particular data from a css file
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
(Rate)

Vimal KandasamyRank #2,151 · 661 reputationPosted Feb 12, 2009, 8:18 PM EST
Simply Read a line and store it in a string and extract the data..see the below example..
StreamReader x = new StreamReader("xyz.css");
String line = x.ReadLine();
int start = line.IndexOf('.');
int end = line.IndexOf('{');
String data = line.Substring(start+1, (end - start)-1);
Now String data has the value between '.' and '{'.. it may be
Addfont
GridLayout
Master Layout...
Try this [code is in C#.Net.]...