使用{{Vlaue}}进行字符串分割

编程入门 行业动态 更新时间:2024-10-19 10:18:16
本文介绍了使用{{Vlaue}}进行字符串分割的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

进度帐单将在适用时开具发票,并受相同条款的约束.万一{{businessName}}有必要执行本协议的任何规定 我需要

progress billings made to meet project requirements will be invoiced when applicable and subject to the same terms. In the event it shall become necessary for {{businessName}} to enforce any of the provisions of this agreement i need

string v1="progress billings made to meet project requirements will be invoiced when applicable and subject to the same terms. In the event it shall become necessary for" ; string v2="{{businessName}}"; string v3="to enforce any of the provisions of this agreement";

请怎么做?

please how to do?

推荐答案

string words = "This is a list of words, with: a bit of punctuation" + "\tand a tab character."; string [] split = words.Split(new Char [] {' ', ',', '.', ':', '\t' }); foreach (string s in split) { if (s.Trim() != "") Console.WriteLine(s); }

有很多方法可以做到这一点-我可能会使用正则表达式: There are a lot of ways to do this - I would probably use a regex: public static Regex regex = new Regex( "(.*?)\\s({{.*?}})\\s(.*)", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Singleline | RegexOptions.CultureInvariant | RegexOptions.Compiled );

此wodl会给您三组,按您的意愿进行分组.

This woudl give you three groups, broken as you wanted.

更多推荐

使用{{Vlaue}}进行字符串分割

本文发布于:2023-11-22 06:24:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616311.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   Vlaue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!