Partager via


Source.GetNewLine(Int32) Method

Definition

Gets the newline character used at the end of the specified line.

public:
 System::String ^ GetNewLine(int line);
public:
 Platform::String ^ GetNewLine(int line);
std::wstring GetNewLine(int line);
public string GetNewLine (int line);
member this.GetNewLine : int -> string
Public Function GetNewLine (line As Integer) As String

Parameters

line
Int32

The line number from which to get the new line character.

Returns

The newline character from the end of the line.

Remarks

This method calls the GetLineDataEx method on the IVsTextLines object passed to the Source class constructor. Based on the return value from GetLineDataEx, the appropriate string is determined. Possible return values are "\r\n" (the default), "\r" (carriage return), "\n" (linefeed), "\u2028" (Unicode line separator), and "\u2029" (Unicode paragraph separator).

An exception is thrown if the line number is out of range.

Applies to