\n not breaking lines in Java
<p>I use a <strong>google api</strong> to <strong>generate a QR code</strong> from some data. It should be represent a <strong>VCARD format</strong>.
I call <a href="http://chart.apis.google.com/chart?cht=qr&amp;chs=300x300&amp;chl=BEGIN%3aVCARD%5CnVERSION:2.1%5CnFN%3aAdam%20Varhegyi%5CnN%3aAdam;Varhegyi%5CnEMAIL%3aadamvarhegyi20@gmail.com%5CnTEL:0670578978%5CnINTERNET%3a;%5Cn%5CnORG%3aEz%20a%20cegem.kft%5CnEND%3aVCARD" rel="nofollow">this</a> url.</p>

<p>When i read the QR code, i nicely got back all the information i added to the link, except one little error.</p>

<p>The <strong>line sperators not working</strong>.</p>

<p><em><strong>I got back this in Java (Android):</em></strong></p>

<pre><code>BEGIN:VCARD\nVERSION:2.1\nFN:Adam Varhegyi\nN:Adam;Varhegyi\nEMAIL:somemai@address.com\nTEL:1234567\nINTERNET:;\n\nORG:Mycompanyname\nEND:VCARD
</code></pre>

<p><em><strong>Instead of this: (\n = linebreaks)</em></strong></p>

<pre><code>BEGIN:VCARD\nVERSION:2.1
FN:Adam Varhegyi
N:Adam;Varhegyi
EMAIL:somemai@address.com
TEL:1234567
INTERNET:;
ORG:Mycompanyname
END:VCARD
</code></pre>

<p>I tryed to work it arround with <strong>using a Scanner</strong> like this:</p>

<pre><code>Scanner sc = new Scanner(myVCardStringInputFromQrCode);
sc.useDelimiter("\n");
while(sc.hasNext()){
    String str = sc.next();
    Log.i("VCARD LINE: ", str);
}
</code></pre>

<p>And this method <strong>only gives back 1 line!</strong> It is <strong>also ignores the "\n" marks.</strong></p>

<p><strong>Edit:</strong></p>

<p>I also tried to use <code>System.getProperty("line.separator")</code> , but no use.</p>

<p><strong>Edit part 2:</strong> </p>

<pre><code>if(myVCardStringInputFromQrCode.contains("\n")){
    Log.i("Found linebreak", "TRUE");
}
else{
    Log.i("Found linebreak", "FALSE");
}
</code></pre>

<p><strong>This code gives me back "FALSE"</strong> - Java says it is not contains "\n" when i clearly see it is.</p>

<p>Anybody know whats happening here?</p>

<p><strong>Edit part 3:</strong> </p>

<p><strong>The correct answer was deleted for some reason so i cannot mark it as "answer".
The solution was "\\n" instead of "\n" and it is working.</strong></p>
