NativeExcel for .Net Developer's Reference

ICharacters.Item Property (Int32)

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

[C#] In C#, this property is the indexer for the ICharacters class.

[Visual Basic]
DefaultPropertyReadOnlyItem(_
ByValStartAsInteger_
)AsICharacters
[C#]
ICharactersthis[
intStart
]{get;}
[C++]
__propertyICharacters*get_Item(
intStart
);
[JScript]
returnValue = ICharactersObject.Item( Start );
-or-
returnValue = ICharactersObject( Start );

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Parameters

Start
A number that indicates one-based start character position.

Property Value

ICharacters

Example

This example deletes the substring starting from index 10 to the end of the string from cell B10.

[C#]
book.Worksheets[1].Range["B10"].Characters[10].Delete();
[VisualBasic]
book.Worksheets(1).Range("B10").Characters(10).Delete()
[C++]
IRange* range = book->Worksheets->Item[1]->Range->Item[S"B10"];
range->Characters->Item[10]->Delete();

See Also

ICharacters Interface | NativeExcel Namespace | ICharacters.Item Overload List | IRange.Characters Property | ICharacters.Count Property