Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
C# Extension Method
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Text; namespace Rextester { public class Program { public static void Main(string[] args) { var message="ajin ae"; //Your code goes here Console.WriteLine("The Result of the message is "+ message.ConvertToPascalCase()); } } public static class StringExtension { public static string ConvertToPascalCase(this string message) { string[] splittedProduct= message.Split(' '); var sb = new StringBuilder(); char[] splittedProductChars; foreach(var s in splittedProduct) { splittedProductChars= s.ToCharArray(); if(splittedProductChars[0] > 0) { splittedProductChars[0]=((new String(splittedProductChars[0],1)).ToUpper().ToCharArray())[0]; } sb.Append(new String(splittedProductChars)); sb.Append(" "); } return sb.ToString().TrimEnd(); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Get Error Message Based on String
Tarkov Time
Daily Coding Problem: Problem #2
wyliczenie 1 dnia tygodnia
числата от 1 до 20
Pyramid
BiologyQuestions
Ternary Operator
2.2 gz
Vajdalinky
stackse - search stackoverflow differently
Please log in to post a comment.