how can i make a substring to bold in string without ant control in C#\ RRS feed

  • Question

  • i want to make a substring to bold in a main string without any control in a form in vb\
    For. eg.
     "I am RK. Back to RK"
    Here i want to make "Back" to font bold without any control on a form.
    How can i do it..?
    Friday, November 23, 2012 6:06 AM

All replies

  • This is an online forum provided by Microsoft about their product "Microsoft Project".  You'll have better luck with your question if you re-post in a more appropriate forum. See or search via Google and/or Bing. 


    Friday, November 23, 2012 7:08 AM
  • Hi you use to linq ,

    for examle ;

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    namespace WebApplication1
        public class Items

            public string Text { get; set; }

        public partial class Default : System.Web.UI.Page
            protected void Page_Load(object sender, EventArgs e)
                string Content = "I am RK. Back to RK";
                List<Items> sList = new List<Items>();
                string[] cList = Content.Split(' ');
                foreach (var item in cList)
                    Items I = new Items
                        Text = item
                string BoldText = "Back";
                foreach (Items replaced in sList)
                    if (replaced.Text == BoldText)
                        Items item = sList.Find(row => row.Text == "Back");
                        if (item != null)
                            item.Text = replaced.Text.Replace(BoldText, "<b>" + BoldText + "</b>");
                    Response.Write(replaced.Text + "<br>");


    here is the result  on


    Monday, November 26, 2012 10:15 AM