java软件工程师学php -9. 字符串处理
程序员文章站
2024-02-08 12:51:34
...
java程序员学php -9. 字符串处理
PHP JAVA标准库或commons-lang的StringUtils
==================================
trim($str) --------- str.trim()
strtoupper($str)----- str.toUpperCase()
ucfirst($str) ------- StringUtils.capitalize(str)
explode(';',$str) ---- StringUtils.split(str, ";")
join(';', $str) --- StringUtils.join(str, ";")
substr($str, 3) --- str.substring(3)
substr($str, -4) --- 无
$str1 == $str2 --- str1.equals(str2)
strlen($str) --- str.length()
strstr($str,'o') --- str.contains("o")
stristr($str,'o') --- str.contains("o") || str.contains("O")
strpos($str, 'o') --- str.indexOf('o')
strrpos($str,'o') --- str.lastIndexOf('o')
str_replace($str, --- StringUtils.replace("str", "abc", "ABC")
'abc', 'ABC')
str_replace( --- 无
$str_array,
$target_array,
$replacement_array)
PHP JAVA标准库或commons-lang的StringUtils
==================================
trim($str) --------- str.trim()
strtoupper($str)----- str.toUpperCase()
ucfirst($str) ------- StringUtils.capitalize(str)
explode(';',$str) ---- StringUtils.split(str, ";")
join(';', $str) --- StringUtils.join(str, ";")
substr($str, 3) --- str.substring(3)
substr($str, -4) --- 无
$str1 == $str2 --- str1.equals(str2)
strlen($str) --- str.length()
strstr($str,'o') --- str.contains("o")
stristr($str,'o') --- str.contains("o") || str.contains("O")
strpos($str, 'o') --- str.indexOf('o')
strrpos($str,'o') --- str.lastIndexOf('o')
str_replace($str, --- StringUtils.replace("str", "abc", "ABC")
'abc', 'ABC')
str_replace( --- 无
$str_array,
$target_array,
$replacement_array)
相关文章
相关视频
上一篇: C#微信开发之微信公众号标签管理功能
下一篇: ,頁面出錯,誰能幫忙看看