Split a string containing command-line parameters into a String[] in Java

后端 未结 6 910
孤街浪徒
孤街浪徒 2020-12-05 10:14

Similar to this thread for C#, I need to split a string containing the command line arguments to my program so I can allow users to easily run multiple commands. For exampl

6条回答
  •  粉色の甜心
    2020-12-05 10:45

    Expanding on Andreas_D's answer, instead of copying, use CommandLineUtils.translateCommandline(String toProcess) from the excellent Plexus Common Utilities library.

提交回复
热议问题