Libs/MojoCube.Api/Text/Function.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web;

namespace MojoCube.Api.Text
{
    public class Function
    {
        public static string SubString(string text, int textLong)
        {
            if (text.Length > textLong)
            {
                text = text.Substring(0, textLong) + "...";
            }
            return text;
        }

        public static string SubString(string text, int textLong, string format)
        {
            if (text.Length > textLong)
            {
                text = text.Substring(0, textLong) + format;
            }
            return text;
        }

        public static string DateTimeString(bool IsDate)
        {
            if (IsDate)
            {
                Random r = new Random();
                return (DateTime.Now.ToString("yyyyMMddHHmmssffff") + r.Next(1000, 9999).ToString());
            }
            else
            {
                return Guid.NewGuid().ToString();
            }
        }

        //匿名处理
        public static string GetAnonymous(string name)
        {
            if (name.Length > 1)
            {
                name = name.Replace(name.Substring(1, 1), "*");
            }
            return name;
        }

        /// <summary>
        /// 将UrlEncode转换成大写输出
        /// </summary>
        /// <param name="s">原字符串</param>
        /// <returns></returns>
        public static string UpperUrlEncode(string s)
        {
            char[] temp = HttpUtility.UrlEncode(s).ToCharArray();
            for (int i = 0; i < temp.Length - 2; i++)
后面还有 17 行代码,购买后查看完整代码

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

AI 解读 AI

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

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