Advertisement
Guest User

asdf

a guest
Jan 25th, 2015
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. public static String method(String s) {
  2. while(s.length != 0) {
  3. String result;
  4. int openComment = s.indexOf("/*");
  5. int closeComment = s.lastIndexOf("*/");
  6.  
  7. if (closeComment == -1 || openComment == -1)
  8. {
  9. result = s;
  10. }
  11. else
  12. {
  13. String newString = s.substring(0, openComment) + s.substring(closeComment + 2);
  14. result = newString;
  15. }
  16. }
  17. return result;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement