Skip to main content

Posts

Showing posts with the label c# online

C# online coding - Run .NET code online

How to run .net code online ? A good question and very useful if you really want an OO programming language for your everyday use.  There are some cool web-hosted runtimes for .NET http://www.ideone.com http://www.codepad.org http://www.coderun.com http://www.compilr.com I use codepad and ideone as they are simple and it JUST works all time!! Please find a simple snippet i wrote // To ensure each tokens are of 3 characters in length (else put space) and concatenate into a single string using System; using System.Collections.Generic; namespace ClassLibrary { class Class1 { static void Main() { string s = "123".PadRight(3).Substring(0,3); string s2 = "".PadRight(3).Substring(0,3); string s3 = "45".PadRight(3).Substring(0,3); string s4 = "6789".PadRight(3).Substring(0,3); System.Text.StringBuilder sb = new System.Text.StringBuilder(); sb.Append(s); sb.Append(s2); sb.Append(s3); sb.Append(s4); Console.Write(sb.ToString()