1. javascript
字符串截取:
var ary=str.split("-");
字符串替换:
①将所有特殊字符都替换掉
key.replace(/:/g,"¥")
将所有的' : '都替换为 ‘¥’。②替换特殊字符串中的第一个
key.replace(":","¥")
字符串中查找特殊字符串(字符)
str.indexOf('d');
字符串长度
str.length
2. php
字符串截取:
$ary=explode('/', $str);
字符串中查找特殊字符串(字符)
strpos($x_value["property"],$searchProperties)
返回的是出现的位置,判断有没有这个字符方法
if(is_numeric(strpos($x_value["property"],$searchProperties))){}
具体看W3School.
字符串长度
echo strlen("Hello world!");
字符串替换
$qian=array('1','2','3','4','5','6','7','8','9','0');
$hou=array("","","","","","","","","","");
$x=str_replace($qian,$hou,$x);
$x_value=str_replace($qian,$hou,$x_value);