book.vb

来自「OOP With Microsoft VB.NET And Csharp Ste」· VB 代码 · 共 31 行

VB
31
字号
Public Class Book

    Public Text As String = ""
    Public PageLength As Integer = 10
    Private m_title As String

    Public Property Title() As String
        Get
            Return m_title
        End Get
        Set(ByVal Value As String)
            m_title = Value
        End Set
    End Property

    Public Function GetPage(ByVal pageNumber As Integer) As String
        Dim start As Integer = (pageNumber - 1) * PageLength
        If (start < Text.Length) And (start >= 0) Then
            If (start + PageLength) < Text.Length Then
                Return Text.Substring(start, PageLength)
            Else
                Return Text.Substring(start, Text.Length - start)
            End If
        Else
            Return ""
        End If
    End Function


End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?