您现在的位置:首页 >> 前端 >> 内容

CSS 文本上下标

时间:2015/3/26 10:36:38 点击:

  核心提示:public string GetHtml(object obj){string result = ;System.Text.RegularExpressions.Regex regex = new ...
public string GetHtml(object obj)
        {
            string result = "";
            System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("{.*,.*,.*}");
            string matchResult = regex.Match(obj.ToString()).ToString();
            if (string.IsNullOrEmpty(matchResult))
            {
                result = obj.ToString();
            }
            else
            {
                string[] strs = matchResult.Replace("{", "").Replace("}", "").Split(',');
                result = "";
                result += "";
                result += "";
                result += "
" + strs[0] + " " + strs[1] + "
" + strs[2] + "
"; } return result; }

 

 

以上代码主要是为了获取3个值, strs[0]=759 strs[1]=+0.6 strs[0]=-0.4 这样用来显示上下 ,如果strs[1] strs[2]未空也行 其中一个有值也行,对应的位置就看实际项目了

 

CSS 文本上下标

 

Tags:CS SS S文 文本 
作者:网络 来源:℡メ㏑╭ァ小凯