我有一个字符串,我想从中删除某个字符。但是,如果该字符在一行中多次出现,我不想删除该字符的实例。例如,我想从字符串中删除“a”,但我不想删除任何子字符串,如“aa”、“aaa”等。我知道如何使用regex来完成相反的操作(替换一行中的多个字符,同时在字符串中保留单独的字符),但我想不出如何做到这一点。
I have a simple problem that says: A password for xyz corporation is supposed to be 6 characters long and made up of a combination of letters and digits. Write a program fragment to read in a string ...