如何忽略以下示例中的大小写?
outText = inText.replaceAll(word, word.replaceAll(" ", "~"));
Run Code Online (Sandbox Code Playgroud)
例:
输入:
inText = "Retail banking Wikipedia, the free encyclopedia Retail banking "
+ "From Wikipedia. retail banking industry."
word = "retail banking"
Run Code Online (Sandbox Code Playgroud)
产量
outText = "Retail~banking Wikipedia, the free encyclopedia Retail~banking " +
"From Wikipedia. retail~banking industry."
Run Code Online (Sandbox Code Playgroud) 如何精确匹配句子中的给定字符串。
例如,如果句子是var句子=“ Google Wave基本上是捕获通信的文档”
而给定的字符串是var inputString =“ Google Wave”。我需要检查上述句子中Google Wave的确切存在并返回true或false。
我试过了
if(sentence.match(inputString)==null){
alert("No such word combination found.");
return false;
}
Run Code Online (Sandbox Code Playgroud)
即使有人输入“ Google W”,此方法也有效。我需要找到完全匹配的方法。请帮忙
我有3个标签.主页,tab1,tab2.当用户启动应用程序时,它会定向到"主页"选项卡并使用" HttpSession session = request.getSession();
当用户浏览到其他选项卡时创建新会话" 时,HttpSession session = request.getSession(false);
如果用户单击"主页"选项卡,我会使用" 即时" 维护会话,我想要销毁上一个会话并重新开始新会议.请告诉我怎么做?