分割字符串以获取结束字符串

编程入门 行业动态 更新时间:2024-10-24 05:17:29
本文介绍了分割字符串以获取结束字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的字符串是 字符串1 --->字符串2 --->字符串3 --->字符串4 --->字符串5 如何仅获取字符串"string1 ---> string2 ---> string3 ---> string"

My string is string1--->string2--->string3--->string4--->string5 how to get the string "string1--->string2--->string3--->string" only

推荐答案

此处 [ ^ ]是有关C#中的字符串操作的链接.当您了解概念时,我相信您会弄清楚使用哪种方法.祝你好运. Here[^] is a link about string manipulation in C#. By the time you understand the concept, I''m sure you''ll figure out what method to use. Good luck.

在这里问不是一个好问题.您应该了解C#或VB.Net字符串操作.有很多方法可以实现这一目标. 顺便说一句,这是一个 Its not a good question to ask here. You should learn about C# or VB.Net string manipulation. There are many ways to achieve this. BTW here is one string str="string1--->string2--->string3--->string4--->string5"; str.Substring(1, str.LastIndexOf(">") - 5);

更多推荐

分割字符串以获取结束字符串

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

发布评论

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

>www.elefans.com

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