A
Aaron
This example that Mun give me (see below) works fine if theres only one set of
bold tags <b>ddf</b> but it would fail if there are more than one
input = "<b>ddf</b><b>dddfs</b>"
output = "ddf</b><b>dddfs"
is there a way to save each word in bold into an array?
Thanks,
aaron
-------------------
Here's my original post
bold tags <b>ddf</b> but it would fail if there are more than one
input = "<b>ddf</b><b>dddfs</b>"
output = "ddf</b><b>dddfs"
is there a way to save each word in bold into an array?
Thanks,
aaron
-------------------
Here's my original post
-------------------------------------------------I need a function in c# that finds and outputs word in bold.
string input = "<b>Hello my name</b> is John"
public string GetBoldWords()
{
//the function
return s // s = "Hello my name"
}
thanks
You could use the regular expression - <b>(.*)</b>.
public string GetBoldWords(string somestring)
{
string foundMatch = string.Empty;
Regex RegExObj= new Regex("<b>(.*)</b>", RegexOptions.IgnoreCase);
System.Text.RegularExpressions.Match MatchObj =
RegExObj.Match(somestring);
if (MatchObj.Success) foundMatch = MatchObj.Groups[1].Value;
return foundMatch;
}
Hope this helps,
Mun