Saturday, January 3, 2009

Color char in any string

string name = "hello vinod how r u";

Random rd=new Random();

CharEnumerator ct = name.GetEnumerator();
while (ct.MoveNext())
{

int r = rd.Next(0, 255);
int g = rd.Next(0, 255);
int b = rd.Next(0, 255);
string rgb = r.ToString() + "," + g.ToString() + "," + b.ToString();
Response.Write("<span style='color:rgb(" + rgb + ");font-weight:bold;font-family:Verdana;font-size:15px'>" + ct.Current + "</span><br />");
}

No comments :

Post a Comment

AJAX, asp, Asp.net, asp.net and sql server security, Asp.net IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath