Click here to Skip to main content
16,011,374 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello All,

i have string="Text";

can anyone help me please how to make Text Bold in String.Format({},"Text"))......

thanks in advance
Posted
Comments
_Asif_ 24-Apr-14 7:22am    
What have you done so far?
CBadger 24-Apr-14 7:27am    
Where is this string used? Label or in another type of container?
GagKumar 24-Apr-14 7:32am    
Hello , i have code used in Extensions.GetLanguageResource("1","Text", "Text"); using VS2010 C#

want to save this text as File.txt in PC, and also show in Console output. am getting output without any Bold. i tried using Regex , normal HTML ....finally String.format. any help please
[no name] 24-Apr-14 7:36am    
You can't. Strings themselves do not have attributes. The "bold" is the responsibility of the display container not of the string.

1 solution

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!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900