我想根据多个分隔符拆分字符串。
如何使用多个字符串作为分隔符拆分字符串?
例如:
我有一个字符串:"/create #channel 'name' 'description of the channel' #field1 #field2"
我想获得一个数组:
/create
#channel
name
description of the channel
#field1
#field2
另一个例子,我有以下代码:"/send @user 'A messsage'"
我想要的是:
/send
@user
A message
如何解决?有什么帮助吗? :-(
'
。 - Gaurav Gupta'description of the channel'
这样的字符串是行不通的。 - Tushar