如何提取特定字符串前后的字符序列?

更新于
2026-09-30 17:54:35
0阅读来源:SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计68个文字,预计阅读时间需要1分钟。

如何提取特定字符串前后的字符序列?

javascript字符串分割,变量keyValue='string'function getStr(string, str) { var currentKey=string.split(str)[0]; var currentValue=string.split(str)[1]; console.log('前' + currentKey + '后' + currentValue);}getStr(keyValue, 'r')

如何提取特定字符串前后的字符序列?

字符串分割

var keyValue = 'string' function getStr(string,str){ var currentKey = string.split(str)[0]; var currentValue = string.split(str)[1]; console.log('前'+ currentKey + '后' + currentValue); } getStr(keyValue,'r')