title: compare two strings and remove common character from second and concatenate uncommon?
body: <p>This is code of compare two strings and remove common character from second 
  and concatenate uncommon. But output is not proper. </p>
  
  <pre><code>import java.util.*;
  
  class str1 { 
      //create class
  
  
      public static void main(String[] args) { 
     //main function
  
          String str = "hello My name is"; 
      //string one
          String str2 = "viral";  
      //string two
  
  
          char s1[] = str.tocharArray();// string convert into character 
          char s2[] = str2.tocharArray();  // string convert into character
  
          for (int i = 0; i &lt; s1.length; i++) {
              for (int j = 0; j &lt; s2.length; j++) {
                  if (s1[i] == s2[j]) {
                      s2[j] = '\0';
                      s2[j] = s2[j + 1];
  
                  }
  
              }
          }
  
          String s1cpy = s1.toString();
          String s2cpy = s2.toString();
  
          String s3 = s1cpy + s2cpy;
  
          System.out.println("the string after removing common character  and concatenation is " + s3);
  
      }
  }
  </code></pre>