SORU
27 Kasım 2008, PERŞEMBE


En iyi yolu bir cümle Pascal Durumda dönüştürmek için

Ne cezası Pascal Case (üst Deve Davası) dönüştürmek için en iyi yoldur.

Örnek ile başlamak için

"AwaitingFeedback"

ve bu dönüştürme

"Awaiting feedback"

C# tercih ama Java veya benzer bir program yazmak istiyorum.

CEVAP
31 Temmuz 2009, Cuma


public static string ToSentenceCase(this string str)
{
    return Regex.Replace(str, "[a-z][A-Z]", m => m.Value[0]   " "   char.ToLower(m.Value[1]));
}

Temel: Converting Pascal case to sentences using regular expression

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • International Secret Agents Concerts

    Internationa

    2 Aralık 2008
  • MW Technology

    MW Technolog

    28 EKİM 2009
  • The Computer Chronicles

    The Computer

    7 Kasım 2012