判断4个字符串比较是否有重复的快捷算法
/**
* 检查4个墙面名称,不能相同
*/
function checkWallName()
{
var repeat = new Array();
repeat.push(wallName1.getValue());
repeat.push(wallName2.getValue());
repeat.push(wallName3.getValue());
repeat.push(wallName4.getValue());
return isRepeat(repeat);
}
function isRepeat(a)
{
return /(\x0f[^\x0f]+)\x0f[\s\S]*\1/.test( "\x0f "+ a.join( "\x0f\x0f ") + "\x0f ");
}