Using '\n' to split lines

I've used '\n' to split lines of text but it doesn't work with all phones. Is there any other way to do it? I'm not using canvas.
append("Title"+'\n'+"something");Edited by: Sypress on Mar 13, 2010 11:12 PM

Use an array of length 2 to store the Strings or if they are related use a Map<String,String> or use Map.Entry if only a sing pair is required or create your own pair class, or ....
The best approach though is to use an object to store them rather than relying on some delimiter and custom parsing method.

Similar Messages

  • Substitution of Split Line Items that appear only in FI - New GL?

    Hi,
    The new GL incorporation has brought in a functionality to automatically split user entered line items during GL Posting to create ledger balance at Profit Centre(or Company code) level in-case line items have multiple Pofit Centres(or Co.Code) etc.
    I have a requirement wherein I need to do substitution and validation of line-items created after splitting of document(which are visible only in general Ledge view of New GL). The line-items created after splitting don't show at runtime(ie during substitution using GGB1), we can only see user entered line-items that are present in BKPF and BSEG tables.
    Is there any way by which we can get hold of system created split line items that are present only in FAGLFLEXA/FAGLFLEAXT table for substitution/validation ?
    I need to substitute Transaction Type field BEWAR.
    Message was edited by: Tabishul Haque

    All ,
    As per SAP it doesn't allow substitution of fields after splitting of documents in new GL in case of Cross Profit Centre documents postings.

  • Batch split line in delivery

    Hi,
    In my system, I have configured automatic batch determination for my delivery item category.
    Now when the system determines the batch, even if there is one batch, the system creates a batch split line (with line number as 900001).
    Is this a standard system behaviour?
    Is there a way that we can have only one line if there is just one batch and go to a batch split line only when there are more than 1 batches.
    pls let me know. Any help would be highly appreciated.
    Thanks
    AB

    Hi Arijeet,
    please do the follow .
    SPRO: LOGISTIC EXECUTION->SHIPPING->DELIVERIES->DEFINE ITEM CATEGORIES
    Choose the item categories you use and check the flag "autobatchdeterm".
    Make sure that you have the right item category determination for the delivery type with Usage: CHSP (take delivery LF as an example). The path is:
    SPRO: LOGISTIC EXECUTION->SHIPPING->DELIVERIES->DEFINE ITEM CATEGORY DETERMINATION.
    Then you have to activate the ATP check in delivery process:
    SPRO: SALES..->BASIC FUNCTION->AVAILABILITY..->AVAILABILITY CHECK->AVAILABILITY CHECK WITH ATP LOGIC->CARRY OUT CONTROL...
    you have to check the configuration for the combination:
    CH Batches - B SD delivery and
    02 Individ.requirements (if you use it in the MRP of you material master) - B SD delivery.
    if you give me brief i can help you out more.
    Thank you .
    Regards
    Ram

  • How to adjust splitted lines into one line in Text file?

    Hi Guys,
    I have a text file with 3 fields(comma separated): GLCode (Number), Desc1 (Char), Desc2(Char) and need to load it into BW.
    My Text file looks like:
    1011.00,"Mejor PC Infrastructure","This line is ok."
    1012.00,"Telephone Equipment $","This line ends in next line.   
    1)Need to change the equipment immediately.
    2)Take immediate action"
    1013.00,"V1 Computer Server Infrastructure # Equip","For purchases
    of components that make up the company's network, such as servers, hubs, routers etc."
    1014.00,"Flash Drive","Need to provide all IT Developer"
    This is how file looks like. Now I need the followings:
    1. Need to remove the space and need to adjust the splitted line into one. Say here
    line/record 2 is splitted into 3 lines and need to adjust in 1 line.
    2. In Line 5 (Record 3) data splitted into 2 lines and need to make 1 line.
    3. Need to remove bad characters.
    Could someone help me please how to proceed ?
    Regards,

    Not quite correct by my testing.  Try:
    $i=0
    Get-Content .\test.txt | ForEach {
    If ($i%2){
    ("$Keep $($_)").Trim()
    }Else{
    $keep=$_
    }$i++
    Good catch!
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • How can i plot a histogram with using the results of Line Length

    PLS HELP.How can i prepare a histogram with using the results of line length code(It is somewhere in the middle).
    This is a final exam take-home question. I would appreciate if you can help?
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    import java.text.*;
    import java.io.File;
    public class WordAnalyser extends JFrame implements ActionListener
    private JMenuItem jmiAc, jmiSil, jmiCikis, jmiAnaliz, jmiHakkinda, jmiKullanim;
    private JTextArea jta1, jta2;
    private JFileChooser jFileChooser = new JFileChooser();
    File hafizada;
    File aktarilan = new File("Sonuc.txt");
    // Main method
    public static void main(String[] args)
    WordAnalyser frame = new WordAnalyser(); /* Ana ekran olusturulur */
    frame.setSize(400, 300); /* Degerleri belirlenir */
    frame.setVisible(true); /* Gorunebilirligi ayarlanir */
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    public WordAnalyser()
    setTitle("Serkan Ozgen Dosya Inceleme Programina Hos Geldiniz");
    JMenuBar mb = new JMenuBar();
    setJMenuBar(mb);
    JMenu fileMenu = new JMenu("Dosya");
    fileMenu.setMnemonic('F');
    mb.add(fileMenu);
    JMenu helpMenu = new JMenu("Degerlendirme");
    helpMenu.setMnemonic('H');
    mb.add(helpMenu);
    JMenu kullanimMenu = new JMenu("Kullanim Kilavuzu");
    mb.add(kullanimMenu);     
    fileMenu.add(jmiAc = new JMenuItem("Ac", 'A'));
    fileMenu.add(jmiSil = new JMenuItem("Sil", 'S'));
    fileMenu.add(jmiCikis = new JMenuItem("Cikis", 'C'));
    helpMenu.add(jmiAnaliz = new JMenuItem("Analiz", 'D'));
    helpMenu.add(jmiHakkinda = new JMenuItem("Hakkinda", 'H'));
    kullanimMenu.add(jmiKullanim = new JMenuItem("Kullanim"));     
    getContentPane().add(new JScrollPane(jta1 = new JTextArea()), BorderLayout.CENTER);
    getContentPane().add(jta2 = new JTextArea(), BorderLayout.SOUTH);
    jmiAc.addActionListener(this);
    jmiSil.addActionListener(this);
    jmiCikis.addActionListener(this);
    jmiAnaliz.addActionListener(this);
    jmiHakkinda.addActionListener(this);
    jmiKullanim.addActionListener(this);
    public void actionPerformed(ActionEvent e)
    String actionCommand = e.getActionCommand();
    if (e.getSource() instanceof JMenuItem)
    if ("Ac".equals(actionCommand))
    Ac();
    else if ("Sil".equals(actionCommand))
    Sil();
    else if ("Cikis".equals(actionCommand))
    System.exit(0);
    else if ("Analiz".equals(actionCommand))
    sayim();
    else if ("Hakkinda".equals(actionCommand))
    JOptionPane.showMessageDialog(this,
    "!!!! Bu program text analizi gerceklestirir. Her hakki saklidir SERKAN OZGEN!!!!",
    "Bu program hakkinda",
    JOptionPane.INFORMATION_MESSAGE);
    else if ("Kullanim".equals(actionCommand))
         JOptionPane.showMessageDialog(this,
         " Ilk once dosya menusunden Ac i tiklayarak analiz etmek istediginiz Dosyayi seciniz (Lutfen uzantisi *.txt \nveya *.log olsun). Daha sonra Degerlendirme menusunden analizi tiklarsaniz dosyanizda kac adet rakam, harf, \ncumle ve kelime oldugunu gorebilirsiniz. Simdiden kolay gelsin",
         "Programin kullanim detaylari",
         JOptionPane.INFORMATION_MESSAGE);
    private void Ac()
    if (jFileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
    hafizada = jFileChooser.getSelectedFile();
    Ac(hafizada);
    // Acilan Dosyayi ana ekranda gostermeye yariyan bir method
    private void Ac(File file)
    try
    // Acilan dosyayi okuma ve ana ekranda gosterme
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
    byte[] b = new byte[in.available()];
    in.read(b, 0, b.length);
    jta1.append(new String(b, 0, b.length));
    in.close();
    catch (IOException ex)
    // Temizle tusunun hangi ekranlara etki edecegini secme
    private void Sil()
    jta1.setText("");
    jta2.setText("");
    private void sayim()
    int buff;
    int sayac = 0;
    int Cumleler = 0;
    int Kelimeler = 0;
    int Karakterler = 0;
    int Satirlar = 0;
    int Rakamlar = 0;     
    boolean start = true;
    int linenum = 0;     
    try
    FileInputStream instream = new FileInputStream(hafizada);
    FileOutputStream outstream = new FileOutputStream(aktarilan);
         BufferedReader infile = new BufferedReader(new InputStreamReader(new FileInputStream(hafizada)));
    PrintStream out = new PrintStream(outstream);
         out.println("---Kelime Avcisinin Sonuclari---");
         String line = infile.readLine();
         while (line != null){
         int len = line.length();
         linenum++;
         line = infile.readLine();
         out.println("Line Length :"     + linenum + "\t" +len);
    while ((buff=instream.read()) != -1)
    switch((char)buff)
    case '?': case '.': case '!': /* Eger "?", "." veya "!" gorurse program cumleleri ve kelimeleri arttirir*/
    if (start == false)
    Cumleler++;
    Kelimeler++;
    start = true;
    break;
    case ' ': case '\t': case ',': case ';': case ':': case'\"': case'\'': /* Eger /t,;:\ ve \" bu isarteleri goruruse program kelimeleri arttirir */
    if (start == false)
    Kelimeler++;
    start = true;
    break;
              case 'n': case '\n': /* Eger \n gorurse satirlari arttirir */
              if (start == false)
                   Satirlar++;
                   Kelimeler++;
                   start = true;
              break;
    default:
    if (((char)buff >= 'a' && (char)buff<='z')|| /*a-z, A-Z veya - degerlerini gorurse karakterler arttirilir */
    ((char)buff >= 'A' && (char)buff<='Z')||
    ((char)buff == '-'))
    Karakterler++;
    if ((Kelimeler % 50) == 49)
    if (start == true)
                   out.println();     
    out.print((Kelimeler+1) + " ");
    out.print((char)buff);
    start = false;
              if ((char)buff >='0' && (char)buff <='9') {  /* 0-9 gorurse rakamlari arttiri */
                   Rakamlar++; }
    }// switch
         }//while
    instream.close();
    out.println();
    out.println();
    out.println("Karakter sayisi: " + Karakterler);
         out.println("Kelime sayisi: " + Kelimeler);
    out.println("Cumle sayisi: " + Cumleler);
         out.println("Satir sayisi: "+ Satirlar);
         out.println("Rakam sayisi: "+ Rakamlar);
    outstream.close();
    try
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(aktarilan));
    byte[] b = new byte[in.available()];
    in.read(b, 0, b.length);
    jta2.append(new String(b, 0, b.length));
    in.close();
    catch (IOException ex)
    catch (Exception e)
    System.out.println(e);
    }

    Why is it that you're not interested in IOExceptions?
    catch (IOException ex)
    } Empty catch blocks is a hallmark of foolish Java code. At least print out the stack trace.
    %

  • I can not re install Adobe Acrobat 7.0 professional on my computer.  It is saying a qualifying product is not detected. I cant even get through using the customer service line they provide 800-272-3623.  This is the worst interactionI have ever had with a

    i can not re install Adobe Acrobat 7.0 professional on my computer.  It is saying a qualifying product is not detected. I cant even get through using the customer service line they provide 800-272-3623.  This is the worst interactionI have ever had with a company.

    Hi joej49728017,
    I am so sorry for the inconvenience caused. However this is just because Adobe Acrobat 7.0 is an outdated version & the now the activation server for it does not exist.
    Please refer to the following KB doc.  Error: "Activation Server Unavailable" | CS2, Acrobat 7, Audition 3
    The above link will help you to  install a special version that does not require activation.
    In case you further need any help, please let us know. We will be more than happy to help you.
    Regards,
    Aadesh

  • How to use the "target Data lines"?

    Hello,
    I want to program some DSP effects and filters with Java. I know to use the "Clip" and the "Sound" data lines in the Java Sound API, but it is difficult to me tu use the "target data lines" to do what I want to. So I have several questions :
    I have found how to convert a clip to a target data line. I have understood how to get the int from the sounds via the target data line. But, when I have done the operations with this int, how to do again a sound from the int? Wich method must I use to "convert the int to a sound"?
    Normally, oscillators and filters need to do an integration using the sample rate. Does anyone could give to me some exemples?
    I have found code sources for C++ for DSP. Where could I find the same for Java?
    Do you know a book about this subject, I did not find any?
    Thank you for your help.

    My idea is to create a byte array from the audio clip via a ByteArrayOutputStream, then to create an int or a float, then do the operations, and then do another audio line from the new byte array. Am I wrong?This is correct, I believe.
    This byte array will have a size of 16 (for PCM or wave files) surrely.Not necessarily. If you're using 16-bit samples for PCM data, then every 2 array positions will be "a sample". Your byte array will be 2 times the number of samples.
    You'll want to pull the data 2-bytes at a time and do basiclly:
    byte[] data_in = new byte[2];
    myTargetDataline.read(data_in, 0, 2);
    short sample = (data_in[0] << 8) + (data_in[1]);Then do whatever you want to your sample, and then write it back...
    byte[] data_out = new byte[] {
    (byte)(sample >>> 8),
    (byte)(sample )
    mySourceDataline.write(data_out, 0, 2);I used a short instead of an int because it's 16-bit data, so it's a short. PCM may be an "unsigned" short, but you'll have to check into that yourself ;-)
    To be perfectly honest, I've never done this so my sample code will probably need to be tweaked. But I hope it helps you get headed in the right direction, and gimme an update when you try it out.

  • When using large text my lines overpal, how can I increase the line spacing?

    When using large text my lines overpal, how can I increase the line spacing?

    Press 'Ctrl + Enter' after the numbered item to insert blank space below it. If you press 'Enter', the next line will start with the next number. As long as you want to type lines without a numbering, press 'Ctrl + Enter' and type the line.

  • Problem using java String.split() method

    Hi all, I have a problem regarding the usage of java regular expressions. I want to use the String.split() method to tokenize a string of text. Now the problem is that the delimiter which is to be used is determined only at runtime and it can itself be a string, and may contain the characters like *, ?, + etc. which are treated as regular expression constructs.
    Is there a way to tell the regular expression that it should not treat certain characters as quantifiers but the whole string should be treated as a delimiter? I know one solution is to use the StringTokenizer class but it's a legacy class & its use is not recommended in Javadocs. So, does there exist a way to get the above functionality using regular expressions.
    Please do respond if anyone has any idea. Thanx
    Hamid

    public class StringSplit {
    public static void main(String args[]) throws Exception{
    new StringSplit().doit();
    public void doit() {
    String s3 = "Dear <TitleNo> ABC Letter Details";
    String[] temp = s3.split("<>");
    dump(temp);
    public void dump(String []s) {
    System.out.println("------------");
    for (int i = 0 ; i < s.length ; i++) {
    System.out.println(s);
    System.out.println("------------");
    Want to extract only string between <>
    for example to extract <TitleNo> only.
    any suggestions please ?

  • I have the Photoshop Elements 11 and when I use the stamp effect the image becomes totally black. It used to have my line drawing in white, now, just a black image. I need the stamp effect. also, most other effects simply crash the program.

    I have the Photoshop Elements 11 and when I use the stamp effect the image becomes totally black. It used to have my line drawing in white, now, just a black image. I need the stamp effect. also, most other effects simply crash the program.

    Which operating system are you using?
    Some filters like Filter>Sketch>Stamp need to have two different colors for the Foreground and Background set in the toolbox.
    Press the D key to set the default toolbox color swatches to Black and White and then try the Stamp filter.
    If your using mac os x 10.9 or 10.10, then some of the filters under Filter>Sketch will crash pse 11
    They are Filter>Sketch>Comic, Graphic Novel and Pen and Ink
    Otherwise resetting the pse11 editor preferences might resolve the crashing.
    Go to Photoshop Elements Editor(Edit)>General, click on Reset Preferences on Next Launch and then restart the pse 11 editor

  • I frequently use Lightroom 3.6 for tethered capture on location. If I sign up for Adobe cloud and upgrade to Lightroom 5, do I have to be online all the time to use it? In other words, can I still use the program off-line?

    I frequently use Lightroom 3.6 for tethered capture on location. If I sign up for Adobe cloud and upgrade to Lightroom 5, do I have to be online all the time to use it? In other words, can I still use the program off-line?

    Yes.
    The only difference is the installation method and the ownership verification. The program still is installed on and runs from your local machine. You only have to hook up to the internet every 60-90 days to verify ownership.
    From the FAQ
    Do I need to be online to access my desktop apps?
    No, the desktop applications in Creative Cloud, such as Photoshop and Illustrator, are installed directly on your computer, so you don’t need an ongoing Internet connection to use them.
    An Internet connection is required the first time you install and license your apps, but you can use the apps in offline mode with a valid software license. The desktop apps will attempt to validate your software licenses every 30 days.
    Annual members can use the apps for up to 99 days in offline mode. Month-to-month members can use the software for up to 30 days in offline mode."

  • How to use stripline in ssrs line chatrs

    Hi,
    I want to know how to use striplines in ssrs line charts?

    Hi ,
    You can use below link;
    https://msdn.microsoft.com/en-us/library/dd239316.aspx?f=255&MSPPError=-2147217396
    https://sqlserverbiblog.wordpress.com/tag/strip-line/
    http://blogs.adatis.co.uk/blogs/jeoc/archive/2013/07/23/adding-strip-lines-to-reports.aspx
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • Weird Battery Usage Using the Dock's Line-Out

    I have noticed something particularly weird about using my iPod w/the dock's line-out. (I have the original 60GB photo).
    When I use the dock's line-out to connect to my home stereo via an RCA cable, I get roughly 3 hours of continuous play on a full charge before the battery meter changes decreases.
    But when I use the dock's line-out to connect to my PC computer speakers via an RCA cable (at work), I get roughly 2 hours of continuous play on a full charge before the battery meter changes decreases.
    Anyone have any ideas what may be causing the shorter battery life while listening via PC speakers?
    Lisa

    Hi Carl - thanks for the reply. I consistently get 15 hours of continuous play from my battery. Yep, the battery & meter are properly calibrated (in fact, I'm pretty anal about that!) I'm not sure I'm getting less battery life, per se, I just find it interesting that I get 2 different readings from using the line-out in 2 different configurations. I'm assuming that maybe the PC speakers are using more power? I'm not electrically-inclined, and maybe I'm just going on a wild goose chase!
    Lisa

  • SPA 9000 - Is it possible to use only the FXS lines (a la SPA2102) ?

    SPA 9000 - Is it possible to use only the FXS lines (a la SPA2102) ?    At this moment I have not received the 9x2 series phones I ordered, but am trying to set up the SPA9000.

    yes, it would work. 

  • Witch software can i use to do split screen on video editing on a macbook

    witch software can i use to do split screen on video editing on a macbook pro
    please apple people without using the very expensive final cut

    iMovie 11 has split screen. Enable the Advanced Tools in iMovie Preferences. Then drag one clip on top of the other and choose split screen.
    Final Cut Express and Final Cut Pro will allow you to do this with a lot more control.

Maybe you are looking for

  • Can some help with CR2 files ,Ican`t see CR2 files in adobe bridge

    can some help with CR2 files ,I can`t see CR2 files in adobe bridge when I open Adobe Photoshop cs5- help- about plugins- no camera raw plugins. When i go Edit- preference and click on camera raw  shows message that Adobe camera raw plugin cannot be

  • Snow Leopard shutting down with no warning is getting more complex!

    I have a series 1 Macbook Pro and have updated to Snow Leopard. As with most other people I immediately got problems with the "battery Service" message. So, having read all the various posts, and tried re-calibration, I bought a new battery. Charged

  • Using CL_ABAP_TYPEDESCR for local itabs?

    Can I get the component table of a locally defined internal table using cl_abap runtime class/methods?

  • How to locate runtime error trigger

    I know I should read the manual to deal with the debugger.  I'm not there yet. <g> Anyhow, here's what the debugger is rendering:     at Website_fla::MainTimeline()[Website_fla.MainTimeline::MainTimeline:2] Cannot display source code at this location

  • Is kinect for xbox one can use kinnect sdk below 1.8?

    hello, i'm trying to develop some software with kinect.  and I've heard that kinect for xbox one 's hardware is pretty better than old one. but tech page says nothing about older sdk below 1.8. I know that sdk 2.0 is better than old ones. but I have