Groups | Blog | Home
all groups > asp.net > december 2003 >

asp.net : GetBoldWords()


kuya789 NO[at]SPAM yahoo.com
12/31/2003 11:26:05 PM
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"
}

kuya789 NO[at]SPAM yahoo.com
1/1/2004 3:23:09 PM
THanks

[quoted text, click to view]
Munsifali Rashid
1/1/2004 5:12:32 PM
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



[quoted text, click to view]

Prasanna Rajupeta
1/5/2004 2:59:43 AM


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

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button