GetBoldWords()

  • Thread starter Thread starter Aaron
  • Start date Start date
A

Aaron

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
 
THanks

Munsifali Rashid said:
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



Aaron said:
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
 
Hello,

I need function in VB.net to elimanate anchor elements.

I have a page containing n no of anchor elements.
i want to remove the anchor elements
ex:


<a href="#" onclick="ShowMyPage('shriya','Shriya ');">
Shriya
</a>
<a
href='TuitionrequestDetails.aspx?alertID=7&UserID=shriya&Status=Deleted
tuition&FromDate=03 Jan 2004 ' class="v11copy" >
TELUGU
</a>

Anchor elements must be eleminated,
The ouput must be Shriya and Telugu


Can any body help me in this


Regards,
Rajupeta Prasanna
 
Back
Top