.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Text;
using System.IO;

public class Program
{
	public static void Main()
	{
		var folder = "one.two.three";
		var newFolder = new StringBuilder();
		
		int index = -1;
		while (index + 1 < folder.Length) {
			index = folder.IndexOf('.', index + 1);
			if (index < 0) {
				newFolder.Append(folder);
				break;
			}
			else {
				newFolder.Append(folder, 0, index);
				newFolder.Append(Path.DirectorySeparatorChar);
			}
		}
		Console.WriteLine(newFolder.ToString());
	}
}
;