Want to replace the size attribute with corresponding value.
i.e
we have this html or strin
In this we have to replace size=12pt and put it back in the string at same place.
We have to cope up pattern with all the condition style and face attribute may be absent and can be any one of them and arrangement may be diffrent
we have to make pattern which full fill all the pattern.
i.e ---->
i.e --->
i.e ----->
so on.
//1:6pt
// 2:8pt
// 3:10pt
// 4:12pt
// 5:14pt
// 6:16pt
// 7:18pt

Hemant SrivastavaPosted May 27, 2015, 4:50 PM
Try this:
public static void Main(string[] args)
{
try
{
//string input = "";
//string input = "";
string input = "";
string pattern = @"\s?size=4\s*";
string replacement = " size=12 ";
Regex rgx = new Regex(pattern);
string result = rgx.Replace(input, replacement);
Console.WriteLine("Original String: \n{0}", input);
Console.WriteLine("Replacement String: \n{0}", result);
Console.ReadLine();
}
catch (Exception exc)
{
Console.WriteLine(exc.Message);
Console.ReadLine();
}
}
Hemant SrivastavaPosted May 29, 2015, 11:32 AM
But still it's not showing the answer as "Accepted Answer".
Just next to my answer on the title section, you would see a check box like " This is correct answer. ", you need to click the check box to set "Accepted". It's good to set an answer if it solves ur problem which helps others too.
Aisha SrivastavaPosted May 29, 2015, 1:03 AM
Hemant SrivastavaPosted May 28, 2015, 10:45 AM
Aisha, It looks like you made the answer 'Accepted' first and again made "Unaccepted". Is it by happened accidently ...?
Anyway for your next question please start a new thread in the forum.
Gowtham RajamanickamPosted May 28, 2015, 10:41 AM
Gowtham RajamanickamPosted May 28, 2015, 10:41 AM
Aisha SrivastavaPosted May 28, 2015, 9:27 AM