22-12-2017, Saat: 12:29
(Son Düzenleme: 22-12-2017, Saat: 12:49, Düzenleyen: Fesih ARSLAN.)
Selamlar
String içindeki kelimerin baş harflerini büyük harf yapmak için böyle bir script buldum.
Belki lazım olur.
Daha kısa yolu varsa paylaşırsanız memnun olurum
[Ars=sql] Create Function [dbo].[FNsv_KelimeBasHarfleriniBuyult]
(@string Varchar(1024) )
Returns Varchar(1024)
As
Begin
Declare @Index Int,
@ResultString Varchar(1024)
Set @Index = 1
Set @ResultString = ''
While (@Index <LEN(@string)+1)
Begin
If (@Index = 1)
Begin
SET @ResultString = @ResultString + Upper(Substring(@string, @Index, 1))
SET @Index = @Index+ 1
End
Else If ((Substring(@string, @Index-1, 1) =' 'or Substring(@string, @Index-1, 1) ='-' or Substring(@string, @Index+1, 1) ='-') and @Index+1 <> Len(@string))
Begin
Set @ResultString = @ResultString + Upper(Substring(@string,@Index, 1))
Set @Index = @Index +1
End
Else
Begin
Set @ResultString = @ResultString + LOWER(SUBSTRING(@string,@Index, 1))
Set @Index = @Index +1
End
End
If (@@ERROR <> 0)
Begin
Set @ResultString = @string
End
Return @ResultString
End
[/ars]
String içindeki kelimerin baş harflerini büyük harf yapmak için böyle bir script buldum.
Belki lazım olur.
Daha kısa yolu varsa paylaşırsanız memnun olurum
[Ars=sql] Create Function [dbo].[FNsv_KelimeBasHarfleriniBuyult]
(@string Varchar(1024) )
Returns Varchar(1024)
As
Begin
Declare @Index Int,
@ResultString Varchar(1024)
Set @Index = 1
Set @ResultString = ''
While (@Index <LEN(@string)+1)
Begin
If (@Index = 1)
Begin
SET @ResultString = @ResultString + Upper(Substring(@string, @Index, 1))
SET @Index = @Index+ 1
End
Else If ((Substring(@string, @Index-1, 1) =' 'or Substring(@string, @Index-1, 1) ='-' or Substring(@string, @Index+1, 1) ='-') and @Index+1 <> Len(@string))
Begin
Set @ResultString = @ResultString + Upper(Substring(@string,@Index, 1))
Set @Index = @Index +1
End
Else
Begin
Set @ResultString = @ResultString + LOWER(SUBSTRING(@string,@Index, 1))
Set @Index = @Index +1
End
End
If (@@ERROR <> 0)
Begin
Set @ResultString = @string
End
Return @ResultString
End
[/ars]
Bu dünyada kendine sakladığın bilgi ahirette işine yaramaz.

