Udostępnij przez


LanguageServer.GetCharPosition(String, Int32) Method

Definition

Get the charactor position (starts with 1) from its line. e.g. "123\n1{2}3" ==> 2 ({x} is the input char at position) "12{\n}123" ==> 3 ('\n' belongs to the previous line "12\n", the last char is '2' with index of 3).

protected static int GetCharPosition(string expression, int position);
static member GetCharPosition : string * int -> int
Protected Shared Function GetCharPosition (expression As String, position As Integer) As Integer

Parameters

expression
String

The expression content.

position
Int32

The charactor position (starts with 0).

Returns

The charactor position (starts with 1) from its line.

Applies to