It's strange to see that there are multiple words in first name. Below is a simple example and you can expand on it using additional functions like listSize (if needed)if ( indexOf("MOHAN DUGGANABOIENA"," ")>=0 )
then
(
(upper(substr(getListItem(split("MOHAN DUGGANABOIENA"," "),0), 0, 1))) + (lowe...