Well, I don't know all codings I think in all of them you can set a variable value as capital. In case of the long string, in Java, for instance you can find in the string vowels with charAt () and multiply it as needed.
I give you a clue in this horrible language: String - 16: Reverse Vowels order in Given String - Bing video. You go all over the string and once you find the last vowel, you just have to capture it.
I'm not saying that you have to use it, this writting is YOUR work. But if you need it in another work, here you are.