|
Tüm harfleri büyütme, küçültme ve kelimelerin ilk harflerini büyütme
1. Girilen tüm harfleri büyüten fonksiyon
Function UCaseEx(Metin) For Uce=1 To Len(Metin)
If Mid(Metin,Uce,1) = "i" Then Metin = Left(Metin,Uce-1) & "İ" & Mid(Metin, Uce+1) If Mid(Metin,Uce,1) = "ı" Then Metin = Left(Metin,Uce-1) & "I" & Mid(Metin, Uce+1)
Next
Uce=0 UCaseEx = UCase(Metin) End Function |
2. Girilen tüm harfleri küçülten fonksiyon
Function LCaseEx(Metin) For Lce=1 To Len(Metin)
If Mid(Metin,Lce,1) = "İ" Then Metin = Left(Metin,Lce-1) & "i" & Mid(Metin, Lce+1) If Mid(Metin,Lce,1) = "I" Then Metin = Left(Metin,Lce-1) & "ı" & Mid(Metin, Lce+1)
Next
Lce=0 LCaseEx = LCase(Metin) End Function |
3. Girilen metnin tüm kelimelerinin ilk harfini büyüten fonksiyon
Function IlkHarfBuyuk(Metin) On Error Resume Next tmpBol = Split(Metin," ",-1,1) For Ihb=0 To UBound(tmpBol) tmpBol(Ihb) = UCaseEx(Left(tmpBol(Ihb),StringBul(tmpBol(Ihb)))) & LCaseEx(Mid(tmpBol(Ihb),StringBul(tmpBol(Ihb))+1)) Next IlkHarfBuyuk = Join(tmpBol, " ") End Function
´String´in ilk karakteri harf değilse harfi bulana kadar ara Function StringBul(Metin) tmpMetin = Metin Set RegEx = New RegExp RegEx.Global = True RegEx.IgnoreCase = True
For i=1 To Len(tmpMetin) RegEx.Pattern = "^[a-zA-ZişğüçöİĞÜŞÇÖ]{1}" If RegEx.Test(Mid(tmpMetin,i,1)) Then StringBul = i Exit For End If Next End Function |
| Not: IlkHarfBuyuk() fonksiyonunun kullanılabilmesi için UcaseEx() ve LCaseEx() fonksiyonlarının olması mecburidir. |
|
 |