RM.Common/DotNetCode/StringHelper.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System.Text;
using System.Text.RegularExpressions;

namespace RM.Common.DotNetCode
{
    public class StringHelper
    {
        public static string WriteString(object obj, string curValue)
        {
            string result;
            try
            {
                string val = obj.ToString();
                if (val == curValue)
                {
                    result = "selected";
                }
                else
                {
                    result = "";
                }
            }
            catch
            {
                result = "";
            }
            return result;
        }

        public static int GetLength(string str)
        {
            int result;
            if (str.Length == 0)
            {
                result = 0;
            }
            else
            {
                ASCIIEncoding ascii = new ASCIIEncoding();
                int tempLen = 0;
                byte[] s = ascii.GetBytes(str);
                for (int i = 0; i < s.Length; i++)
                {
                    if (s[i] == 63)
                    {
                        tempLen += 2;
                    }
                    else
                    {
                        tempLen++;
                    }
                }
                result = tempLen;
            }
            return result;
        }

        public static string GetCenterShow(string p, int size, int font)
        {
            string result;
后面还有 114 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。