You can't.
Strings do not have formatting information: all "features" such as Bold, Underline, Italic and so forth are functions of the display device, not of the text itself, and the exact requirements to display a string as Bold depend on exactly what you are using to display it.
A text file does not have any formatting information - none of it is Bold, or underlined - but the text it contains may contain formatting information that can be interpretted by a particular display device. For websites, that generally means the text containing HTML:
Hello: <b>Bold</b>
But for Rich Text controls that might be:
{\rtf1\ansi Hello: \b Bold\b0.}
And there are loads and loads of other ways to indicate this!