Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
test_プロンプトで入力したメタ文字を再解釈するやつ
//test_プロンプトで入力したメタ文字を再解釈するやつ
var pr = prompt("", ""); //"a\tb", "a\nb" など
alert(pr);
alert(convertToMetaChar(pr));
function convertToMetaChar (str) {
return eval("\"" + str + "\"");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment