This is going to cause an unneeded string allocation and copy. Since provider is going to be assigned to providerName at the end of this block and so doesn't need to be preserved, I would use:

provider[0] = provider.at(0).toUpper()