 <p>The Linq way:</p> <pre><code>var lastname = "Abumademal"; var formatted = (new string(lastname.Take(8).ToArray())).PadRight(lastname.Length, '*'); // will yield "Abumadem**" </code></pre> <p>"Take 8 chars and create a new string from this array, then pad it with as many * as needed."</p> <p>full implementation:</p> <pre><code>private string lastname; public string LastName { get { if (null == this.lastname) { return null; } char[] firsteight = this.lastname.Take(8).ToArray(); string tmp = new string(firsteight); // padding this way wasn't the actual requirement ... string result = tmp.PadRight(this.lastname.Length, '*'); return result; } set { this.lastname = value; } } </code></pre>