다음을 통해 공유


Source.GetNewLine Method

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

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

‘선언
Public Function GetNewLine ( _
    line As Integer _
) As String
‘사용 방법
Dim instance As Source
Dim line As Integer
Dim returnValue As String

returnValue = instance.GetNewLine(line)
public string GetNewLine(
    int line
)
public:
String^ GetNewLine(
    int line
)
member GetNewLine : 
        line:int -> string 
public function GetNewLine(
    line : int
) : String

Parameters

  • line
    Type: System.Int32
    The line number from which to get the new line character.

Return Value

Type: System.String
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.

.NET Framework Security

See Also

Reference

Source Class

Source Members

Microsoft.VisualStudio.Package Namespace