title: Removing Certain Characters inside a String, Java
body: <p>My problem here is that i want a Character remove in some parts of a String but I do not know how to restrict the removing.</p>
  
  <p>Example:</p>
  
  <pre><code>A computer is a general purpose device that can be\n
  programmed to carry out a finite set of\n 
  millions to billions of times more capable.\n
  \n
  In this era mechanical analog computers were used\n
  for military applications.\n
  1.1 Limited-function early computers\n
  1.2 First general-purpose computers\n
  1.3 Stored-program architecture\n
  1.4 Semiconductors and\n
  </code></pre>
  
  <p>this here example is the content of my string, what i want to happen is to remove the <code>\n</code> of lines 1 and 2 above but not to remove the <code>\n</code> in line 5 onwards. <strong>How do i remove the <code>\n</code> without removing the other <code>\n</code>?</strong>. My Goal here is to make the string a paragraph without <code>\n</code> after line. like the example the first 3 lines can be a paragraph and the next lines are in bullet form(example). what i am saying is that I do not want to remove <code>\n</code> in bulleted characters.</p>
  
  <p>The real contents of the string is dynamic.</p>
  
  <p>I have tried using <code>String.replaceAll("\n", " ")</code> well clearly that would not work it will remove all the <code>\n</code> i have thought of using <code>Regex</code> to determine what is Alphanumberic but it would remove some letters after <code>\n</code></p>