PHP 字符串截取
PHP substr strpos
JAVA subString indexof
PHP:
$pos=strpos("12345", "3");
$substring=substr("12345", 0,$pos);
echo $substring;
输出:
12
JAVA:
String str="12345";
int pos=str.indexOf("3");
String substring=str.substring(0, pos);
System.out.println(substring);
输出:
12
浙公网安备 33010602011771号