SwiftUI Text: How to always show the last characters of a text even if the text is too long?

I have a text in a frame that can become too long depending on the user input. If a text is too long in SwiftUI, SwiftUI abbreviates it with "..." at the end.Example:

"That's a very long te..."

But now I want the last x characters to always be displayed, even if the text is too long. A good example of my wish is XCode itself:

I'd be happy for help.

Add the truncation modifier : .truncationMode(.middle)

Text("Some very long text, too long to display entirely").truncationMode(.middle)

Here is a toy example:

struct ContentView: View {
    var body: some View {
        Text("Some very long text, too long to display entirely")
            .frame(width: 300, height: 20)
            .truncationMode(.middle)
    }
}
SwiftUI Text: How to always show the last characters of a text even if the text is too long?
 
 
Q