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 SrivastavaRank #581 · 4.2K reputationPosted May 27, 2015, 12:50 PM EDT
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 SrivastavaRank #581 · 4.2K reputationPosted May 29, 2015, 7:32 AM EDT
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 SrivastavaRank #7,688 · 236 reputationPosted May 28, 2015, 5:27 AM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted May 28, 2015, 6:41 AM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted May 28, 2015, 6:41 AM EDT
Hemant SrivastavaRank #581 · 4.2K reputationPosted May 28, 2015, 6:45 AM EDT
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.
Aisha SrivastavaRank #7,688 · 236 reputationPosted May 28, 2015, 9:03 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts