func generateDescription(_ prefix: String) {
return (prefix + " Some Text Here")
}
let str: String = generateDescription("Some prefix text here")
How do I cast or generate a StaticString from this runtime generated string? I need to pass str to a method from a library that has a StaticString parameter (I have no control over the library).
I am thinking of something like this:
let staticStr = StaticString(str)
But this is not the correct way.
Thanks!
(Btw this is not a duplicate to this question: Convert String to StaticString)