In my current work, I have to write a replace function. A replace function, which take file path ( e.g., /sim/device ) as input and generates output – sim.device.
In java, I have tried with replace("/", "."). But, this function produce output .sim.device.
My question is that ” In Java, is there any function, which solves my purpose or should I write function myself ?” you could suggest efficient java code also.
If you want to ignore the first character you can use substring.
prints