0

I have one HTML file which contains the following:

.CLASS1 {
 font-family: Arial, Helvetica, sans-serif;
 font-size: 18px;
}
.style1 {
 font-family: Arial, Helvetica, sans-serif;
 font-size: 18px;
}
.style4 {
 font-size: 12px;
 font-weight: bold;
 font-family: Arial, Helvetica, sans-serif;
}
.style6 {font-family: Arial, Helvetica, sans-serif}
.style7 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.style13 {font-size: 20px}
.style14 {
 font-size: 22px;
 font-weight: bold;
}
.style15 {font-family: Arial, Helvetica, sans-serif; font-size: 20px; }
.style16 {
 font-size: 15px;
 font-weight: bold;
}
.style18 {font-size: 13px}
.style20 {font-size: 13px; font-family: Arial, Helvetica, sans-serif; }
.style24 {font-family: Arial, Helvetica, sans-serif; font-size: 20px; font-weight: bold; }
.style26 {font-size: 15px; font-weight: bold; font-family: Arial, Helvetica, sans-serif; }
.style27 {font-size: 14px}
.style32 {font-size: 13px; font-family: Arial, Helvetica, sans-serif; font-weight: bold; }
.style33 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.style34 {font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold; } 

I want list in C# that contains

style1
style3
style34
..
..
..
in this manner ..

Thanks in advance.

peSHIr
  • 6,279
  • 1
  • 34
  • 46
SunnyK
  • 1

1 Answers1

0

Might want to have a look at this question: Is there a CSS parser for C#?

If that doesn't do it you should be able to write a fairly simple one using regex to parse it. E.g.

  1. Remove all whitespace.
  2. look for (.*)\{
Community
  • 1
  • 1
Rob Stevenson-Leggett
  • 35,279
  • 21
  • 87
  • 141