|
Friday, 23 December 2011 00:10 |
There are two ways to join multiple strings: using the + operator that the String class overloads, and using the StringBuilder class. The + operator is easy to use and makes for intuitive code, but it works in series; a new string is created for each use of the operator, so chaining multiple operators together is inefficient.
Example: 1
string two = "two";
string str = "one " + two + " three";
System.Console.WriteLine(str);
Example: 2
string two = "two";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("one ");
sb.Append(two);
sb.Append(" three");
System.Console.WriteLine(sb.ToString());
string str = sb.ToString();
System.Console.WriteLine(str);
 Read more: |
|
Sunday, 18 December 2011 14:59 |
|
Setting Up Unison File Synchronization Between Two Servers On Ubuntu 11.10
This tutorial shows how to set up file synchronization between two Ubuntu 11.10 servers with Unison.
Unison is a file-synchronization tool similar to rsync, but the big
difference is that it tracks/synchronizes changes in both directions,
i.e., files changed on server1 will be replicated to server2 and vice
versa. Read more: |