balanceDelimiters()

Parent Previous Next

TwScript:   TW.target.balanceDelimiters();


In the editor, from whee the cursor is,  any text between code "delimiters" will be selcted,

and the delimeters will be as well,

(highlighted) .


Same as the user taping Crtl B, or using Menu/ Edit /Balance delimiters


Works on:—


( )

[ ]

{ }


Presntly not on:—


" "

'  '

< >

` '


Example:


TW.target.balanceDelimiters();


var selText = TW.target.selection;

     selText = selText.substr(1, selText.length -2);


// would return just the contents of the brackets.



Created with the Personal Edition of HelpNDoc: Easily create iPhone documentation