Advertisement
RupeshAcharya60

Given a string, if the string "del" appears starting at inde

May 25th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. public String delDel(String str) {
  2.  
  3. String name=new String();
  4. if(str.length()<3)
  5. {
  6. return str;
  7. }
  8.  
  9. if((str.charAt(1)=='d') && (str.charAt(2)=='e')&&(str.charAt(3)=='l'))
  10. {
  11. return str.replace("del","");
  12. }
  13. else{
  14. return str;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement