NativeExcel for .Net Developer's Reference

ICharacters.Item Property (Int32, Int32)

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.

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

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

[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.
Length
A number that indicates the length.

Property Value

ICharacters

Example

This example changes the substring of cell B10

[C#]
book.Worksheets[1].Range["B10"].Characters[3,2].Text = "new text";
[VisualBasic]
book.Worksheets(1).Range("B10").Characters(3,2).Text = "new text"
[C++]
IRange* range = book->Worksheets->Item[1]->Range->Item[S"B10"];
range->Characters->Item[3,2]->Text = S"new text";

See Also

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