我有以下格式的字符串
id;some text here with possible ; inside
并希望在第一次出现时将其拆分为2个字符串;。因此,应为:id和some text here with possible ; inside
我知道如何分割字符串(例如,使用cut -d ';' -f1),但是由于我;位于左侧,因此它将分割为更多部分。
字符串拆分后,您要如何使用“ id”?您是否要将其分配给变量,将其打印出来等?
—
混沌守护进程2012年
我将有2个变量:
—
gakhov 2012年
id和string
—
通配符