View Code
function GetValueByKey(strs, key, sp)
{
key
= key.toLowerCase();
strs
= strs.toLowerCase();
if (strs.indexOf(key + "=") > -1)
{
var result;
var s = strs.substring(strs.indexOf(key + "="));
if (s.indexOf(sp) != -1)
{
result
= s.substring(s.indexOf(key + "=") + key.length + 1, s.indexOf(sp));
}
else
{
if (s.indexOf(key + "=") != -1)
{
result
= s.substring(s.indexOf(key + "=") + key.length + 1);
}
}
}
return result;
}
// var strs = "A=1,B=2,c=3,d=4,ee=";
// document.write( GetValueByKey(strs, "B", ","));
--value 2
新手 好像代码布局有点乱 没有调好

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-08-09
  • 2021-08-27
猜你喜欢
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-31
  • 2021-11-17
  • 2021-06-12
  • 2022-12-23
相关资源
相似解决方案