LanguageServer.GetCharPosition(String, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.