1
Let’s say I have the following entry String S = "00-44 48 5555 8361"
and that I need to return this character string divided 3 by 3, separated by "-", as follows:
Output: 004-448-555-583-61
The amount of characters may vary. Below the following scope:
public class Solution{
public static String solution(String S){
}
}
public static void main(String[] args) {
String S = "00-44 48 5555 8361";
System.out.print(solution(S));
}
}
In an effective way, how to solve this in Java 8?
Solved, your answer was amazing!
– mayssalns
This Redux does magic, look at the amount of code lines! Very efficient your solution. Thank you very much!
– mayssalns
@ssamaylns If this answer solved your problem and there is no doubt left, mark it as correct/accepted by clicking on " " that is next to it, which also marks your question as solved. If you still have any questions or would like further clarification, feel free to comment.
– Victor Stafusa