How can I convert text to sprite?

How do I convert a text to an image together? I want to convert a text that says string “hello” to sprite.

I think you could capture the text first to a RenderTexture (use a camera to shoot the text element, then save the results to a RenderTexture.) After that is done, use a RawImage component to display the RenderTexture you rendered.