OriginLab Corporation - Data Analysis and Graphing Software - 2D graphs, 3D graphs, Contour Plots, Statistical Charts, Data Exploration, Statistics, Curve Fitting, Signal Processing, and Peak Analysis     
 
Skip Navigation Links
All BooksExpand All Books
Origin CExpand Origin C
Origin C ReferenceExpand Origin C Reference
ClassesExpand Classes
Composite Data TypesExpand Composite Data Types
stringExpand string

2.2.3.11.10 string::GetAt

Description

Return a single character specified by an index number.

Syntax

char GetAt( int nIndex )

Parameters

nIndex
[input] Zero-based index of the character in the string object. The nIndex parameter must be greater than or equal to 0 and less than the value returned by GetLength.

Return

A char containing the character at the specified position in the string.

Examples

EX1

void string_GetAt_ex1()
{
    string str( "abcdef" );
    char chRet = str.GetAt(2);
	printf("%c\n", chRet);// print: c
}

Remark

See Also

string::SetAt, string::GetLength

Header to Include

origin.h

 

© OriginLab Corporation. All rights reserved.