title: What is the most efficient way to get the last line break in a string
body: <p>I have the following function to get the last line break position in a string:</p>
  
  <pre><code>function getLastLineBreak (content) {
      function reverse(s){
          return s.split("").reverse().join("")
      }
      var reversed = reverse(content)
      var index = content.length-reversed.indexOf("\n")
      return index
  }
  
  var myString = "some text \n next linet \n another link \n 123"
  indexIs = getLastLineBreak(myString)
  console.log("index is", indexIs)
  console.log("text after", indexIs, myString.substr(indexIs,myString.length))
  </code></pre>
  
  <p>Is there a way using regular expression to pick up the last line break position within the string in nodejs?</p>