01/10/2018, 12:31
Xoá chuỗi nằm trong dấu ngoặc kép
Nhờ mọi người giúp đỡ
Mình muốn xoá một chuỗi bất kỳ nằm trong một chuỗi như sau :
input : chuoi_bat_ky_ “chuoi_can_xoa” chuoi_bat_ky ví dụ : abcde"123uf3"udud
output : chuoi_bat_ky_ “” chuoi_bat_ky ví dụ abcde""udud
hoặc output là chuỗi xoá luôn cả dấu ngoặc kép còn abcdeudud cũng được .
Cảm ơn mọi người
Bài liên quan
Bạn dùng thử phương thức replace() mà Java cung cấp xem sao?
ở đây mình có một số các phương thức xử lý chuỗi có thể giúp ích cho bạn.
(https://kenhlaptrinh.net/cac-phuong-thuc-xu-ly-chuoi-trong-java/)
Demo regex:
Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript
Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and JavaScript. The website also features a community where you can share useful expressions.
cảm ơn bạn nhé > đúng thứ mình cần