How to make a String with a line break?

I want to insert a line break into a strhing...i am trying to do this using a Stringbuffer the following way:
name = new StringBuffer().append("something").append('\n').append("else").toString();
but it doesnt' seem to be working.
any suggestions??
Andrew

that was just an example for testing purposes...if
you read my posts.....
i said:
"i am passing a string to my corel template creator
which is made in java and creates a template in Corel
Draw.
but when the string is being passed to the template
creator i want it to be able to distinguish whether
the string is supposed to be 2 lines or 1."
i see zero correlation between that and HTML
AndrewYour posts thus far strongly suggest that this text will utimately be HTML that will be rendered by a browser. I don't know what this Corel template is, but based on the other stuff you've said, I assumed it was some sort of HTML page template.
If the text will ultimately be HTML that is rendered by a web browser, then the Corel stuff is irrelevant (unless the Corel template is a JSP or other dynamic page generator that lets you specify by some other means where to put line breaks, in which case you need to look at Croel's docs), and you need to insert <br> or <p> or use <pre> tags.
If the Corel template is some sort of Java widget and you won't be rendering HTML with a web browser, then look at the docs for the Corel template, or contact Corel tech support.

Similar Messages

  • How to create a String with comma ?

    Hi All,
    I have a table with 10 records(employee name) and i have to make a string
    with comma delimiter and at the end with "."
    Can anybody tell me how to write a Java program for this ?
    Thanks in advance.

    // I believe the following example gives you the answer.
    class stringEG {
         public static void main(String args[]) {
         String emprs[] ={"1","2","3","4","5","6","7","8","9","10"};
         String vempname = "";
         for(int i=0; i<emprs.length; i++) {
         if(i == (emprs.length-1))
              vempname = vempname + emprs[i] + ".";
         else
              vempname = vempname + emprs[i] + ", ";
         System.out.println("vempname : "+vempname);
    Here dont assume that I asked you to get all the results and putting
    it into the string arrays. But its a simple example to suit your requirement.
    The half-way coding below answers your question, I hope.
    vempname = "";
    while (emprs.next()) {
    if(emprs.isLast())
    vempname = vempname + emprs.getString("empname") + ".";
    else
    vempname = vempname + emprs.getString("empname") + ", ";
    // nats.

  • String with multiple lines

    hi
    i have a string with multiple lines inside it eg.
    hello this is
    my string with
    mutiple lines inside it
    how could i get it to print out line by line
    iv used "\n" so it detects the new lines but it doesnt seem to work
    this is my following code that doesnt seem to detect the newline
    if(multiString.equals("\n")){
    }

    nicchick wrote:
    i have a string with multiple lines inside it eg.
    hello this is
    my string with
    mutiple lines inside itWhere do you have this String? In a file? in a JTextArea of a Swing GUI? Details are important.
    if(multiString.equals("\n")){But the whole string isn't an "\n" so this won't do. Again, much will depend on the current state of the String. You may need to split it based on the current line separator.

  • How to make text columns with adobe muse

    Hi,How to make text columns with adobe muse (like InDesign)?

    Multiple columns can be acheived with CSS - http://www.w3schools.com/css/css3_multiple_columns.asp
    div
    -moz-column-count:3; /* Firefox */
    -webkit-column-count:3; /* Safari and Chrome */
    column-count:3;
    I'm surprised that Muse does not support text columns yet, but perhaps the custom CSS can be added in style tags on page properties. Haven't tried it, but don't see why it wouldn't work.

  • How to create a String with a specific size?

    how to create a String with a specific size?
    For example I want to create different Strings with the size of 100 , 1000 or 63k byte?

    String are immutable so just initialize it with the number of characters you want.
    You might want to look at java.lang.StringBuffer and see if that's what you want.

  • How to concatenate a string with single quotes

    Hi all,
        how to concatenate a string with single quotes to a variable.
    Sathya

    Hi sathyabama,
    1. simple
    2. use TILDE character <b>(`)</b>
       (just left to the '1' key)
    <b> `'mystring'`</b>
    3. just copy paste
    report abc.
    data : m(100) type c.
    concatenate `'amit mittal'` 'hello' into m separated  by space.
    write m.
    regards,
    amit m.

  • How to print a string with out using main method??

    how to print a string with out using main method??
    if we can tell me with example?
    thanks in adavance
    raja

    Hi,
    actually there's none. The UITableView class needs to "know" the tableView's height so either it can calc <number of rows> times <row height> or it has to sum the height of each single row.
    If the row which needs to be of different size always is the first or the last row you can user a tableHeader or tableFoot view.
    Regards
    Dirk

  • How to make turning page with ibooks author?

    How to make turning page with ibooks author?

    This question has been answered on this thread
    https://discussions.apple.com/message/17981772#17981772#17981772
    Best regards.
    Alex

  • How to make several pushbuttons in one line (on screen)??

    How to make several pushbuttons in one line (on screen)??
    thanks in advance!!!!

    Hi,
    USE
    SELECTION-SCREEN BEGIN OF BLOCK.
    SELECTION-SCREEN BEGIN OF LINE.
    define all buttons between this block.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK.
    selection-screen
    Cheers
    VJ

  • How to make this work with Firefox, HELP!

    Downloading for Real-player, after watching the full movie, I click download and it has to reread the movie from the internet. When using explorer, after downloading the movie, it reads it from memory, which makes it a fast download. How to make this work with Firefox, I like not to use Microsoft products, and I really like Firefox 7.0.1!!!! HELP!

    -> click '''Firefox''' button and click '''Options''' (OR File Menu -> Options)
    * Advanced panel -> Network tab
    * place Checkmark on '''Override Automatic Cache Management''' -> under '''Limit Cache''' specify a large size of space
    * Remove Checkmark from '''Tell me when websites asks to store data for offline use'''
    * click OK on Options window
    * Restart Firefox
    Check and tell if ts working.

  • How to make email link with a button with AC2 in flash cs3?

    How to make email link with a button with AC2 in flash cs3?
    I wrote this, but it does not work:
    btn_emailinfo.on (release) {
    getURL("mailto:"[email protected]");
    }

    I am guessing you put that on a frame?
    If so, the syntax is as follows:
    btn_emailinfo.onRelease = function(){
    getURL("mailto:[email protected]");
    Though, if you are placing it directly on the button itself,
    the syntax is:
    on(release){
    getURL("mailto:[email protected]");
    }

  • I reset my phone and it now receives calls that were meant for my husband. I know how to fix this with messaging and facetime, but can't seem to find how to make it stop with the calls. Please help.

    I reset my phone and it now receives calls that were meant for my husband. I know how to fix this with messaging and facetime, but can't seem to find how to make it stop with the calls. Please help.

    It may be due to Continuity
    The following quote is from  Connect your iPhone, iPad, and iPod touch using Continuity
    Turn off iPhone cellular calls
    To turn off iPhone Cellular Calls on a device, go to Settings > FaceTime and turn off iPhone Cellular Calls.

  • In JSF, how to make a menu with access control?

    In JSF, how to make a menu with access control?
    The access control can be guided by programming, database or other means if possible?
    Thanks

    I want to make a dvd menu in iMovie because i don't have IDVD and can't find anywhere to download it?
    For making DVDs I would recommend iMovie 06 and iDVD 09 both readily available on Amazon or eBay.  Shop for iLife 06 and iLife 09.
    You can make menus and chapters with any version of iMovie except the latest one. There's nothing wrong with iMovie 11 either but I prefer iMovie 06.
    By using iMovie 06 and iDVD 09 I make DVDs with professional moving menus with very little effort. They look almost as good as Hollywood.

  • How to make slide images with Dreamweaver CS6?

    How to make slide images with Dreamweaver CS6? Please teach me.

    Hello
    in addition to Jon's hint, I'll send you some links to nice sliders (have fun with the different representations ):
    http://sandbox.scriptiny.com/javascript-slideshow/
    http://jquery.malsup.com/cycle/
    http://wowslider.com/best-jquery-slider-crystal-linear-demo.html
    http://www.jcoverflip.com/demo
    http://www.jacksasylum.eu/ContentFlow/
    http://addyosmani.com/blog/jqueryuicoverflow/
    You only need to use the source code to implant these shows there where you want. In my eyes it would be the best that you use first a very new and blank DW file to perform (maybe in LiveView) the one or the other.
    Hans-Günter

  • How to combine a bar with a line in a chart

    Post Author: rbcdexia
    CA Forum: Charts and Graphs
    We want to combine data in bars and with a line showing in one chart.
    Is that possible? How do you configure your chart?
    The line and the bars are based on the values from different fields in the same table.

    Post Author: pareshb
    CA Forum: Charts and Graphs
    We are using Crystal Reports for Visual Studio 2005. Can you please let me know how to combine a bar with a line chart.
    Thanks in advance.Paresh

Maybe you are looking for

  • Monitor adapter for macbook pro and dell monitor

    Hello, I have a MacBook Pro and a Dell monitor. The laptop has Mac OS X (Version 10.6.8). The model of the Dell monitor is a Dell E193FPp. I'd like to know what monitor adapter to get to be able to connect the 2 together. Anyone have any ideas? Any h

  • "Unable to connect to secure server." Why?

    Safari previously operating OK under OS 10.3.9 suddenly starts reporting "Unable to connect to secure server" with a number of (maybe all?) <https://> sites. Explorer doesn't exhibit this problem. Removing Safari .plist, clearing caches, and removing

  • X-FI - 4.1 Rear Speaker Prob

    I've just installed the X-FI platinum, and have a 4. setup. After hooking things up appropriately, I run the THX Setup Console, and find that the front left and right speakers are hooked up properly (FL comes out of FL, FR comes out of FR), but the r

  • How to change the frequency of time machine back ups

    Time machine backs up every hour. And it takes several minutes. I don't need to back up that often. Once a day is fine. But I don't see any way to set the frequency of back ups.

  • Conforming audio caches time & again

    Hi to all of you! I put on this question but have received no answers yet. I specifically want to know if that has something to do with file formats or the local network and where the cache files are being saved? I've got a problem with premiere CC w