CSharp examples for Custom Type:Indexer
Object Initializer Indexer
using System;/*from w ww .java 2 s .com*/ using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; class ObjectInitializerIndexer { static void Main() { string text = "This text needs truncating"; StringBuilder builder = new StringBuilder(text) { Length = 10, [9] = '\u2026' }; Console.OutputEncoding = Encoding.UTF8; Console.WriteLine(builder); } }