SORU
9 EKİM 2009, Cuma


Python ile basit bir şekilde bir dizi birden çok boşluk kaldırmak için

Bu varsayalım dize:

The   fox jumped   over    the log.

Neden olur:

The fox jumped over the log.

Bu basit, 1-2 astarı nedir? Bölme olmadan ve listelerine girecek...

CEVAP
9 EKİM 2009, Cuma


>>> import re
>>> re.sub('  ',' ','The     quick brown    fox')
'The quick brown fox'

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • LaKe Lightroom Tutorials

    LaKe Lightro

    22 Temmuz 2014
  • SDSARG3

    SDSARG3

    14 Mart 2009
  • thewinekone

    thewinekone

    17 Aralık 2005