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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

GetBoldWords 1
GetBoldWords() 1
Last Modified By in a cell by user 3
Use of class function 2
Using Renesas E1 Emulator with LabVIEW 0
Repeater question 4
Windows 7 Setting up Wake on LAN 3
2 C# Class's Questions 4

Back
Top