模糊查询关键字高亮显示

   需求每天都有,很无奈, 老板提出要求 必须要做,,这此说要把查询出来的关键字高亮显示,于是想了想,以前用过Replace方法的 两个参数的重载版本:

public string Replace(char oldChar, char newChar);
        //
        // 摘要:
        //     将此实例中的指定 System.String 的所有匹配项替换为其他指定的 System.String。
        //
        // 参数:
        //   oldValue:
        //     要替换的 System.String。
        //
        //   newValue:
        //     要替换 oldValue 的所有匹配项的 System.String。

 

 

 

  应用代码: ///

/// 返回高亮显示的字 /// /// /// public string gaoliang(string dt) { dt=dt.Replace(str, "" + str + ""); return dt; }

你可能感兴趣的:(asp.net)