Is it important?
It is good to have those details in mind but is it really important right now in your development to know isif a string will be allocated or not and if it will be a bottleneck for your application?
If yes, try both and measure. Chance are the difference is either minimal (compare to other algorithm issues) or null. If there really is a diffecrence you'll know wich solution to adopt.
If no, go with what's clearer (IMO the first one), and when you'll stumble upon performance issues, then you can profile your code to see where real bottlenecks are.