I have a String S= "grep -iRl 2020062312213461801003087/var/seamless/spool/tdr/Reconciliation"
and i want to add space between last number and "/"
like i want my output to be grep -iRl 2020062312213461801003087 /var/seamless/spool/tdr/Reconciliation
Try this.
String S= "grep -iRl 2020062312213461801003087/var/seamless/spool/tdr/Reconciliation";
String replaced = S.replaceAll("(\\d)(/)", "$1 $2");
System.out.println(replaced);
result:
grep -iRl 2020062312213461801003087 /var/seamless/spool/tdr/Reconciliation