zoukankan      html  css  js  c++  java
  • 字符串剪切方法

             /// <summary>
            /// 将指定字符串进行剪切
            /// </summary>
            /// <param name="oldStr">字符串</param>
            /// <param name="marLenth">指定长度</param>
            /// <param name="endWith">尾部</param>
            /// <returns></returns>
            public static  string StringTruncate(string oldStr,int marLenth,string endWith)
            {
                if (string.IsNullOrEmpty(oldStr))
                {
                    return endWith;
                }
                if (marLenth < 1)
                {
                    throw new Exception("返回的字符串长度必须大于【0】");
                }
                if (oldStr.Length>marLenth)
                {
                    string strTmp = oldStr.Substring(0, marLenth);
                    if (string.IsNullOrEmpty(endWith))
                    {
                        return strTmp;
                    }
                    else
                    {
                        return strTmp + endWith;
                    }
                }
                return oldStr;
            }

  • 相关阅读:
    矢量坐标矩阵 为了方便求叉乘
    力矩 是形容物理转动效果的量
    科式力 河流右边冲刷严重
    科式力
    证明科式力 coriolis acceleration
    叉乘的求导证明
    spring webFlux的认识
    [转] DB2错误代码说明
    MySQL事务及其实现
    MySQL基础架构之查询语句执行流程
  • 原文地址:https://www.cnblogs.com/liuyunpiaohe/p/1707264.html
Copyright © 2011-2022 走看看