// Get last n characters from string var name = 'Shareek'; var new_str = name.substr(-5); // new_str = 'areek'