これが私のコードです:
def split_string(source,splitlist):
sl = list(splitlist)
new = source.split(sl)
return new
私がそれを実行すると:
print split_string("This is a test-of the,string separation-code!"," ,!-")
次のエラーがあります。
new = source.split(sl)
TypeError: expected a character buffer object
どうすればこれを修正できますか?
注:最初に、リスト内のすべての要素でsplitlist
分割したいよりもリストを作成したいと思います。source
sl
ありがとう。