첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
class StringHelper:
    def __init__(self, source = None):
        self.__source = source

    def __sub__(self, removeCharacterList):
        for removeCharacter in removeCharacterList:
            self.__source = self.__source.replace(removeCharacter, "")

        return StringHelper(self.__source)

    def Remove(self, removeCharacterList):
        return self.__sub__(removeCharacterList)

    def GetString(self):
        return self.__source

helper = StringHelper("ABCDEFabcdefg")

print(helper.GetString())

helper - "ACE"

print(helper.GetString())

"""
ABCDEFabcdefg
BDFabcdefg
"""
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요