how to use string index