【发布时间】:2019-02-12 17:49:37
【问题描述】:
我想知道如何从用户发送的消息中拆分特定字符串 消息看起来像这样
"username: @newbie <----- need to recive the all string with the '@'
password: 1g1d91dk
uid: 961515154 <-- always string of 9 numbers
message: blablabla < ---- changing anytime how can i recive the string after message:"
date: 30/06/18"
mnumer: 854762158 <-- always string of 9 numbers to but i want to upper one
我的意思是在 "uid:" 之后得到 9 digits ?
非常感谢! 我发现了一个类似的问题,但没有一个回答我的问题 对不起,我的英语不是母语的拼写
【问题讨论】:
-
能否请您提供一些示例:初始字符串和期望的结果,例如
"username @me\r\npassword: 123\r\nmnumer: 123456789" -> ("me", "123456789") -
我的问题中的所有代码部分都是我想要做的就是从中拆分出我在代码部分中提到的值
-
是一个长字符串,就像@DmitryBychenko 发布的那样,还是多个字符串?即
string userName = "username :@newbie"、string passWord = "password: 1g1d91dk"等 -
它的一个长字符串就是我想说的,我想单独接收而不是一起
-
@Greg,Fildor,主要是 Tim 粗鲁。