NativeExcel for .Net Developer's Reference

ICharacters.ItemProperty

Returns an ICharacters interface that represents a subsequence of characters within the specified Characters object.

Overload List

Returns an ICharacters interface that represents a subsequence of characters within the specified Characters object. The subsequence starts at a specified character position.

[Visual Basic] DefaultPropertyReadOnlyItem(ByValInteger)AsICharacters
[C#] ICharactersthis[int]{get;}
[C++] __propertyICharacters*get_Item(int);

Returns an ICharacters interface that represents a subsequence of characters within the specified Characters object. The subsequence starts at a specified character position and has a specified length.

[Visual Basic] DefaultPropertyReadOnlyItem(ByValInteger,ByValInteger)AsICharacters
[C#] ICharactersthis[int,int]{get;}
[C++] __propertyICharacters*get_Item(int,int);

Example

This example deletes substring from A1 cell value

[C#]
book.Worksheets[1].Range["A1"].Characters[3,4].Delete();
[VisualBasic]
book.Worksheets(1).Range("A1").Characters(3,4).Delete()
[C++]
book->Worksheets->Item[1]->Range->Item[S"A1"]->Characters->Item[3,4]->Delete();
This example gets the substring from A1 cell value.
[C#]
string txt = book.Worksheets[1].Range["A1"].Characters[3,5].Text;
[VisualBasic]
Dim txt As String = book.Worksheets(1).Range("A1").Characters(3,5).Text
[C++]
String* txt = book->Worksheets->Item[1]->Range->Item[S"A1"]->Characters->Item[3,5]->Text;
This example appends text at the end of B10 cell
[C#]
ICharacters c = book.Worksheets[1].Range["B10"].Characters;
c[c.Count + 1, 0].Insert("text"); 
[VisualBasic]
Dim c As ICharacters = book.Worksheets(1).Range("B10").Characters
c(c.Count + 1, 0).Insert("text") 
[C++]
ICharacters* c = book->Worksheets->Item[1]->Range->Item[S"B10"]->Characters;
c->Item[c->Count + 1, 0]->Insert(S"text");

See Also

ICharacters Interface | NativeExcel Namespace | IRange.Characters Property | ICharacters.Count Property