当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


VB.NET LCase()用法及代码示例

LCase() 函数用于将指定的字符串转换为小写。

用法:

LCase(Str)

参数:

  • Str:指定要转换为小写的字符串。

返回值:

LCase() 函数将返回小写字符串。

程序/源代码:

下面给出了演示 LCase() 函数的源代码。给定的程序已成功编译并执行。

'VB.Net program to demonstrate the LCase() function.

Module Module1

    Sub Main()
        Dim str As String = "I Love India"
        Dim LCaseStr As String

        LCaseStr = LCase(str)

        Console.WriteLine("Lowercase string:{0}", LCaseStr)
    End Sub
    
End Module

输出:

Lowercase string:i love india
Press any key to continue . . .

说明:

在上面的程序中,我们创建了一个包含 Main() 方法的模块 Module1。在Main()方法中,我们创建了两个变量str和LCaseStr,这里变量str初始化为“I Love India”,变量LCaseStr初始化为空字符串。

LCaseStr = LCase(str)

在上面的代码中,我们使用了将返回小写字符串的 LCase() 函数。然后我们在控制台屏幕上打印字符串。





相关用法


注:本文由纯净天空筛选整理自 VB.Net program to demonstrate the LCase() function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。