📄 convert.js
字号:
function convert(str)
{
var newstr = "";
for(i=0;i<str.length;i++)
{
var ch =str.charAt(i);
switch(ch)
{
case String.fromCharCode(13) : newstr=newstr+"<br>"; break;
case String.fromCharCode(32) : newstr=newstr+" "; break;
case "<" : newstr=newstr+"<"; break;
case ">" : newstr=newstr+">"; break;
case String.fromCharCode(34) : newstr=newstr+"""; break;
case "'" : newstr=newstr+"''"; break;
case "&" : newstr=newstr+"&"; break;
default : newstr+=ch;
}
}
return newstr;
}
//---------revers convert
function reconvert(str)
{
var newstr = "";
newstr = str.replace("<br>",String.fromCharCode(13));
newstr = str.replace(" "," ");
newstr = str.replace("<","<");
newstr = str.replace(">",">");
newstr = str.replace(""",String.fromCharCode(34));
newstr = str.replace("''","'");
newstr = str.replace("&","&");
return newstr;
}
//---------check space
function isSpace(str)
{
for(i=0;i<str.length;i++)
{
if(str.charAt(i) != " ")return false;
}
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -