fixed lastIndexOf

add demo, fixed bug