private static CharAt ( IContext context, object @this, object arguments ) : object | ||
context | IContext | |
@this | object | |
arguments | object | |
return | object |
private static object CharAt(IContext context, object @this, object[] arguments)
{
string str = (string)@this;
int index = Convert.ToInt32(arguments[0]);
if (index < 0 || index >= str.Length)
return string.Empty;
return str.Substring(index, 1);
}