Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String method(String s) {
- while(s.length != 0) {
- String result;
- int openComment = s.indexOf("/*");
- int closeComment = s.lastIndexOf("*/");
- if (closeComment == -1 || openComment == -1)
- {
- result = s;
- }
- else
- {
- String newString = s.substring(0, openComment) + s.substring(closeComment + 2);
- result = newString;
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement