我试过这个:
$string ="Group: ALL:ALL:Good";
@str2 = split (/:/,':',2);
print "@str2";
Run Code Online (Sandbox Code Playgroud)
我正在寻找$str[0] = Group 和$str[1]= ALL:ALL:Good.
它不起作用.会有什么问题?
Tho*_*mas 11
你不是这个意思吗?
@str2 = split (/:/,$string,2);
Run Code Online (Sandbox Code Playgroud)
否则,你将分裂字符串:,这似乎没有意义.