Last active
July 22, 2016 00:48
-
-
Save uprime22/bc641275166f2c827f9dc7c168647ccb to your computer and use it in GitHub Desktop.
表示される文字列と、文字列データと、文字列リテラルを区別する必要を示す一例。 関数T.currentで得られる文字列データは、 引用符を抜いた文字列リテラル、と同じに見なしてはいけない。 エスケープ済みの文字列リテラルと同等とみなすべき。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Textwellの現在行にテスト用文字列"\s \n "などを置き、実行。 | |
var str = '\\s \\n test'; | |
var crt = T.current; | |
var ptn1 = RegExp(str,'g'); | |
var ptntxt= ptn1.toString(); | |
var ptn2 = RegExp(crt,'g'); | |
var crttxt = ptn2.toString(); | |
alert('文字列リテラル:\"\\\\s \\\\n test\"\n' + ptntxt + '\n\nT.current\n'+ crttxt ); | |
T('done'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment