Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 645

String CenterAlign

$
0
0
I wonder how this code affects perfomance on servers used to build up to 50 string lines per tick every 10-th tick
Code:
#region String Extensions
		static string CenterAlign(string source, int space)//centers string space wide
		{
			if (source == "" || space <= 0) return "";//input empty or no space? return empty		 
			else
			{
				int length = source.Length; //source length
				if (space == length) return source;//return source if its length == space
				else if (space > length) return...
String CenterAlign

Viewing all articles
Browse latest Browse all 645

Trending Articles