且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将字符串拆分为两个并存储在两个变量中

更新时间:2023-01-19 22:29:53

您需要阅读有关字符串函数的文档,其中一些允许您获取一部分内容string。
You need to read the documentation about string functions, a few of them allow you to get a part of a string.


我们不做你的作业:它是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



所以首先要看一个正则表达式(搜索对于正则表达式c#)并获取 Expresso 的副本[ ^ ] - 它是免费的,它会检查并生成正则表达式,或者查看字符串处理函数:string.Split,string .IndexOf和string.Substring方法。



亲自试试,你可能会发现它并不像你想象的那么难!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

So start by looking at either a Regex (Search for "Regular Expressions c#") and get a copy of Expresso[^] - it's free, and it examines and generates Regular expressions, or look at the string handling functions: string.Split, string.IndexOf, and string.Substring methods.

Try it yourself, you may find it is not as difficult as you think!