这里有一个参数解析器的列表(点击此处),但它们只接受字符串数组作为输入。
现在,我有一个字符串:
有没有工具可以做到这一点? 另请参阅 编辑 作为答案发布。
现在,我有一个字符串:
-s -d "String with space" -d "string with \" escape \n the next line"
我想把字符串拆分成
-s
-d
String with space
-d
string with " escape
the next line (This is one string with \n)
有没有工具可以做到这一点? 另请参阅 编辑 作为答案发布。
String
split
呢?试试用String.split
。 - Scary Wombat