3

phone_replace.py

 1 year ago
source link: https://gist.github.com/kd0g/87f629e29857865f7599049359a67e05
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

PangMo5 commented 2 days ago

edited

제가 파이썬이 주 언어가 아니라 잘 모르긴하는데
pnum = pnum.replace('010', '+82 10') 와 같이 replace하면 전체문자열에서 010이 모두 +82 10 으로 변경되어서
전화 번호가 01001001001 일경우 +82 10+82 10+82 1001 로 변경 되지 않을까여?
뒤에 count를 붙혀줘서 변경 할 횟수를 지정해야될듯합니다.

Author

kd0g commented yesterday

제가 파이썬이 주 언어가 아니라 잘 모르긴하는데
pnum = pnum.replace('010', '+82 10') 와 같이 replace하면 전체문자열에서 010이 모두 +82 10 으로 변경되어서
전화 번호가 01001001001 일경우 +82 10+82 10+82 1001 로 변경 되지 않을까여?
뒤에 count를 붙혀줘서 변경 할 횟수를 지정해야될듯합니다.

그러게요; 왠지 제가 갖고 있는 연락처 중에도 잘못 변환된 전화번호 있을 것 같습니다.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK