fdt: Add a function to get the index of a string