Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Convert String to Pig Latin
//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; namespace Rextester { public class Program { public static void Main(string[] args) { string str = "test test test hello world pig latin"; Console.WriteLine(MakePigLatin(str)); } public static string MakePigLatin(string str) { string[] words = str.Split(' '); str = String.Empty; for (int i = 0; i < words.Length; i++) { if (words[i].Length <= 1) continue; string output = new String(words[i].ToCharArray()); output = output.Substring(1, output.Length -1) + output.Substring(0, 1) + "ay "; str += output; } return str.Trim(); } } }
run
|
edit
|
history
|
help
0
Pizzas&Tuples&Golden-Medal
nthFromLastElement
Free cash app money
Shalini_CSG_CodeTest
barcos
asxasxsd
Xml in C#
Reverse a string
Великий и могучий РУСЯЗ
Rank