重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
就是你在写代码是用大写字母和小写字母vb.net认为都一样,没区别。你定义变量时Abc
网站建设公司,为您提供网站建设,网站制作,网页设计及定制网站建设服务,专注于成都企业网站定制,高端网页制作,对成都石雕等多个行业拥有丰富的网站建设经验的网站建设公司。专业网站设计,网站优化推广哪家好,专业成都网站推广优化,H5建站,响应式网站。
使用时 用abc 它自动会把 abc改成Abc。
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim s As String = "0Ff0ajkh04624F"
Dim i As Integer = 0
Dim sTemp As String = ""
Dim ss As String = ""
For i = 1 To Strings.Len(s)
sTemp = Mid(s, i, 1)
If Asc(sTemp) = 65 And Asc(sTemp) = 90 Then
sTemp = LCase(sTemp)
ElseIf Asc(sTemp) = 95 And Asc(sTemp) = 122 Then
sTemp = UCase(sTemp)
Else
sTemp = sTemp
End If
ss = ss sTemp
Next
MsgBox(ss)
End Sub
可以试着用典型的VB字符串函数UCase解决。
比如先把输入的内容放到字符串A$中,若A$="a",则经
A$=UCase(A$)转换后,结果即是A$="A"。
我在程序中是这麽处理的。行不行,试试就知道了。
'代码来源:代码街codejie.net
'由于在vb.net里变量名不区分大小写(StuName和stuname是一样的),所以个别变量名需要修改
'在vb.net中,模块级变量的命名原则是以m_开头
Public Class Student
Private m_stuNo As String '学生号字段
Private m_stuName As String '学生姓名字段
Private m_stuAge As Integer '学生年龄字段
Private m_stuAddress As String '学生住址字段
'无参构造方法
Public Sub New()
End Sub
'有参构造方法
Public Sub New(ByVal stuNo As String, ByVal stuName As String, ByVal stuAge As Integer, ByVal stuAddress As String)
m_stuNo = stuNo
m_stuName = stuName
m_stuAge = stuAge
m_stuAddress = stuAddress
End Sub
'学生号属性
Public Property StuNo() As String
Get
Return m_stuNo
End Get
Set(ByVal value As String)
m_stuNo = value
End Set
End Property
'学生姓名属性
Public Property StuName() As String
Get
Return m_stuName
End Get
Set(ByVal value As String)
m_stuName = value
End Set
End Property
'学生年龄属性
Public Property StuAge() As Integer
Get
Return m_stuAge
End Get
Set(ByVal value As Integer)
m_stuAge = value
End Set
End Property
'学生住址属性
Public Property StuAddress() As String
Get
Return m_stuAddress
End Get
Set(ByVal value As String)
m_stuAddress = value
End Set
End Property
End Class
1:将文件拷贝到WORD中
2:点击菜单“格式”——更改大小写,出现对话框
3:可以选择“大写”或者“切换大小写”,就都可以换过来了
最后,再复制回到你所需要的文档中即可!
String的成员函数中就有 ToUpper() 和 ToLower()啊
Dim a As String = "abcEd"
Dim b As String = a.ToUpper() //大写
Dim c As String = a.ToLower() //小写