I have a string with the value "Program", and I want to find the index of character 'g' in that string.
You are looking for the find method for String. To find the index of 'g' in "Program" you can do
find
'g'
"Program"
"Program".find('g')
Docs on find.