Joris Dresselaers

I want to know God's thoughts... the rest are details. - Albert Einstein

Blog code formatting

Hi guys,

While writing my first blog post, I stumbled on the following problem: how do I format the code that I want to publish on the blog? It seems that when I paste my code in the blog editor, I lose all formatting (except for the coloring).

My good friend Wesley told me that a website exists for creating formatted C# code. In my google search (the first link I came across actually) I found a website that will do exactly that.

This site can transform C#, vb and some other code types into the correct format. Jaj!

I will give a before-after example of a testclass I created. Please don't mind the code, just mind the formatting.

Before:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Reflection

{

public static class Class1

{

public static void SomeMethod(params string[] stackParams)

{

Class2.SomeOtherMethod();

}

}

}

 After:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Reflection
{
public static class Class1
{
public static void SomeMethod(params string[] stackParams)
{
Class2.SomeOtherMethod();
}
}
}

 

Best formatting wishes to you ;-)

Posted: Feb 14 2008, 06:37 AM by Jokke | with 1 comment(s)
Filed under: ,

Comments

admin said:

For those who would like some other flavors, have a look at

qbnz.com/.../index.php

cheers :)

# February 24, 2008 1:36 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: