I have a list that contains a comma but I also have others commas in the same list I dont want to remove, so I wonder is there a way to only delete the last comma of every line of text?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you mean remove the last character if it is a comma, then you should do something like
replace
^(.*),$with$1a,b,c,will be replaced toa,b,c, anda,b,c,dwill not match the regex.If you means just remove the last comma, even there are something after it, do something like replace
^(.*),([^,]*)$with$1$2a,b,c,will be replaced toa,b,c, anda,b,c,dwill be replaced toa,b,cd