排名
1
文章
860
粉丝
112
评论
163
.net core自定义项目模板,创建自己的模板项目,使用命令行创建模板项目
尘叶心繁 : 可以可以讲真的我都想弄个模板
net core webapi post传递参数
庸人 :
确实坑哈,我也是下班好了好几次,发现后台传递对象是可以的,但...
.net webapi 返回需要的字段,忽略某些字段,修改字段名等
雨雨雨雨雨辰 : 已精
.net webapi 返回需要的字段,忽略某些字段,修改字段名等
雨雨雨雨雨辰 :
疯狂反射
百度编辑器自定义模板
庸人 : 我建议换个编辑器,因为现在百度富文本已经停止维护了,用tinymec...
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

使用字符串分割方法即可
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace ConsoleApplication1
- {
- public class Program3
- {
- public static string[] Split(string source, string separtor)
- {
- List<string> strList = new List<string>();
- while (true)
- {
- if (string.IsNullOrWhiteSpace(source))
- break;
- //找到需要拆分字符串的位置
- int poi = source.IndexOf(separtor);
- if (poi < 0)
- {
- strList.Add(source);
- break;
- }
- string item = source.Substring(0, poi);
- if (!string.IsNullOrWhiteSpace(item))
- {
- strList.Add(item);
- }
- //去已经拆分的和分割需要的字符串去掉,留下剩下的继续拆
- source = source.Substring(poi + separtor.Length);
- }
- return strList.ToArray();
- }
-
- static void Main(string[] args)
- {
- string str = "aaa|||bbb|||||ccc||||||ddd|||";
- //3,0-3 aaa -->bbb|||ccc
- //bbb ccc
- string[] strs = Split(str, "|||");
- }
- }
- }
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)
评价