Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8775d8b9
Kaydet (Commit)
8775d8b9
authored
Haz 11, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added capitalize() and capwords().
üst
2e1beeac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
string.py
Lib/string.py
+10
-0
stringold.py
Lib/stringold.py
+10
-0
No files found.
Lib/string.py
Dosyayı görüntüle @
8775d8b9
...
...
@@ -262,6 +262,16 @@ def translate(s, table):
res
=
res
+
table
[
ord
(
c
)]
return
res
# Capitalize a string, e.g. "aBc dEf" -> "Abc def".
def
capitalize
(
s
):
return
upper
(
s
[:
1
])
+
lower
(
s
[
1
:])
# Capitalize the words in a string, e.g. " aBc dEf " -> "Abc Def".
# See also regsub.capwords().
def
capwords
(
s
):
return
join
(
map
(
capitalize
,
split
(
s
)))
# Try importing optional built-in module "strop" -- if it exists,
# it redefines some string operations that are 100-1000 times faster.
# It also defines values for whitespace, lowercase and uppercase
...
...
Lib/stringold.py
Dosyayı görüntüle @
8775d8b9
...
...
@@ -262,6 +262,16 @@ def translate(s, table):
res
=
res
+
table
[
ord
(
c
)]
return
res
# Capitalize a string, e.g. "aBc dEf" -> "Abc def".
def
capitalize
(
s
):
return
upper
(
s
[:
1
])
+
lower
(
s
[
1
:])
# Capitalize the words in a string, e.g. " aBc dEf " -> "Abc Def".
# See also regsub.capwords().
def
capwords
(
s
):
return
join
(
map
(
capitalize
,
split
(
s
)))
# Try importing optional built-in module "strop" -- if it exists,
# it redefines some string operations that are 100-1000 times faster.
# It also defines values for whitespace, lowercase and uppercase
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment