I have a string like this:
line = "Student = Small |1-2| Student"
I want to replace this line to
line = "StudentShort = Small |1-2| StudentShort"
The problem is I don't know wheither first and last words are Student or anything else in string. I mean it can be Men, Women, Teacher anything.
I only know that if there is small in string I have to replace first and last word with that name and short
Can some one help?