Advertisement
Guest User

Untitled

a guest
May 28th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function charIdx2LineCharIdx(str:String, charIdx:int, lineDelim:String):Point
  2. {
  3.     var line:int = str.substr(0,charIdx).split(lineDelim).length - 1;
  4.     var chr:int = line > 0 ? charIdx - str.lastIndexOf(lineDelim,charIdx) - lineDelim.length : charIdx;
  5.  
  6.     return new Point(line, chr);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement