Javascript 拆分多个字符时出现问题
我有这样的句子 现金为王。在你准备会计计划的那一天,我确信你会认真起草会计准则,我们的账目不需要粉饰。先生,你写叙述 我想把这句话和你分开?和 为此,我使用了Javascript 拆分多个字符时出现问题,javascript,split,Javascript,Split,我有这样的句子 现金为王。在你准备会计计划的那一天,我确信你会认真起草会计准则,我们的账目不需要粉饰。先生,你写叙述 我想把这句话和你分开?和 为此,我使用了 var words= 'Cash is king. The day you prepared the accounting plan, I was sure that you will draft the accounting standards carefully and our accounts will not be require
var words= 'Cash is king. The day you prepared the accounting plan, I was sure that you will draft the accounting standards carefully and our accounts will not be required to be window dressed. Sir you write the narration.';
var split = words.split(".");
console.log(split);
这是工作,但我想分裂的句子?和两者同时存在。我该怎么做
有人能帮我做这件事吗?你可以在这两件事上分开做?和同时使用.split的正则表达式格式,即:
示例代码段:
var测试=abc?定义ghi;
var零件=测试分割/[?。]/
logpartscheck this:注意字符串操作是javascript而不是jquery,我稍微更新了标记+问题以反映这一点。
words.split(/[?.]/)