title: String Manipulation Problems in Java
body: <p>I have the below 2 Problems asked yesterday in an interview</p>
  
  <p>1>  Given a string, compute a new string where identical chars that are adjacent in the original string are separated from each other by a "*". </p>
  
  <p>Examples are as shown below::<br>
  function name is <code>public String pairStar(String str)</code></p>
  
  <pre><code> pairStar("hello") → "hel*lo"     
   pairStar("xxyy") → "x*xy*y"          
   pairStar("aaaa") → "a*a*a*a"
  </code></pre>
  
  <p>2> Given a string, compute a new string where all the lowercase 'x' chars have been moved to the end of the string. </p>
  
  <p>Examples are as shown below::<br>
   function name is <code>public String endX(String str)</code></p>
  
  <pre><code>endX("xxre") → "rexx"     
  endX("xxhixx") → "hixxxx"     
  endX("xhixhix") → "hihixxx"
  </code></pre>
  
  <p>Im not sure how to accomplish the given set of problems, and struggling how to solve this </p>