using System;
using System.Security;
public class Example
{
public static void Main()
{
char[] chars = { 't', 'e', 's', 't' };
// Instantiate the secure string.
SecureString testString = new SecureString();
// Assign the character array to the secure string.
foreach (char ch in chars)
testString.AppendChar(ch);
// Display secure string length.
Console.WriteLine("The length of the string is {0} characters.", testString.Length);
}
}