aspose file tools*
The moose likes Beginning Java and the fly likes How can I make a String bold in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How can I make a String bold in java" Watch "How can I make a String bold in java" New topic
Author

How can I make a String bold in java

Stanley Mungai
Ranch Hand

Joined: Dec 09, 2011
Posts: 155

Hi guys am reading from a text file and passing the String to am Email Body. Is there a way of making the String Bold. For example




is there a way of making the String Line bold when it is transferred to the email body??


Give a beggar a fish; feed him for a day. Teach him how to fish; Feed him for a lifetime.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4392
    
    8

Strings by themselves don't contain any formatting - they're just a collection of characters. Whether you can add formatting to your email depends on the type of email you're creating. So if it's a plain text email, there's nothing you can do. If you're creating an HTML email then you can add HTML formatting (so you can put <b> tags around the text in question). This is going to be determined by how the email is getting sent, which isn't part of the code you're showing.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How can I make a String bold in java