Mega Code Archive

 
Categories / Delphi / Forum
 

Neoturk - büyükharfe çeviren function

herkese merhaba, işte sizlere basit bir büyük harfe çeviren function... {arhive by neoturk} {************** büyük harfe çeviren fonksiyon **************************} function bh(x:string):string; var m:integer;t1,t2:string; begin t1:='';t2:='';x:=trim(x); for m:=1 to length(x) do begin if x[m]='ğ' then t2:='Ğ' else if x[m]='ü'then t2:='Ü' else if x[m]='ş'then t2:='Ş' else if x[m]='i'then t2:='İ' else if x[m]='ö'then t2:='Ö' else if x[m]='ç'then t2:='Ç' else if x[m]='ı'then t2:='I' else t2:=uppercase(x[m]); t1:=t1+t2; end; bh:=t1; end; function bh2(x:string):string; var m:integer;t1,t2:string; begin t1:='';t2:='';x:=trim(x); for m:=1 to length(x) do begin if x[m]='ğ' then t2:='G' else if x[m]='ü'then t2:='U' else if x[m]='ş'then t2:='S' else if x[m]='i'then t2:='I' else if x[m]='ö'then t2:='O' else if x[m]='ç'then t2:='C' else if x[m]='ı'then t2:='I' else t2:=uppercase(x[m]); t1:=t1+t2; end; bh2:=t1; end; kullanımı: x:='iyi günler'; x2:=bh(x); // İYİ GÜNLER x2:=bh2(x); // IYI GUNLER türkçe harflere duyarlı olduğunu göreceksiniz... delphideki UPPERCASE functionu bu konuda yetersizdi... kullananlar bilirler.. saygılarımla_ xxnt03@lycos.co.uk neoturk_