コード例 #1
0
ファイル: CRegex.cs プロジェクト: y03005b72/weiyouproject
        /// <summary>
        /// 文章来源
        /// </summary>
        /// <param name="sInput">输入内容</param>
        /// <param name="sRegex">表达式字符串</param>
        public static string GetSource(string sInput, string sRegex)
        {
            string sSource = GetText(sInput, sRegex, "Source");

            sSource = CString.ClearTag(sSource);
            if (sSource.Length > 99)
            {
                sSource = sSource.Substring(0, 99);
            }
            return(sSource);
        }
コード例 #2
0
ファイル: CRegex.cs プロジェクト: y03005b72/weiyouproject
        /// <summary>
        /// 作者名
        /// </summary>
        /// <param name="sInput">输入内容</param>
        /// <param name="sRegex">表达式字符串</param>
        public static string GetAuthor(string sInput, string sRegex)
        {
            string sAuthor = GetText(sInput, sRegex, "Author");

            sAuthor = CString.ClearTag(sAuthor);
            if (sAuthor.Length > 99)
            {
                sAuthor = sAuthor.Substring(0, 99);
            }
            return(sAuthor);
        }
コード例 #3
0
ファイル: CRegex.cs プロジェクト: y03005b72/weiyouproject
        /// <summary>
        /// 文章标题
        /// </summary>
        /// <param name="sInput">输入内容</param>
        public static string GetTitle(string sInput, string sRegex)
        {
            string sTitle = GetText(sInput, sRegex, "Title");

            sTitle = CString.ClearTag(sTitle);
            if (sTitle.Length > 99)
            {
                sTitle = sTitle.Substring(0, 99);
            }
            return(sTitle);
        }
コード例 #4
0
 /// <summary>
 /// 清除标签
 /// 截取字符串
 /// </summary>
 /// <param name="str">要进行切割的字符串</param>
 /// <param name="len">返回的长度(自动识别中英文)</param>
 public static string CutString(string str, int len, bool bAddDot)
 {
     return(CString.GetLetter(CString.ClearTag(str), len, bAddDot));
 }