Complete a string base on index of last character : <p>Example Word : String , the returned last index is 5 which is "g". I need to complete the word string base on the space before the word.</p>

<p>For example</p>

<p>obj string the last index is 5, which is g, "string" word should be completed.</p>
