VB学习第四周--字符函数验证
2013-03-27 22:09
323 查看
字符函数验证:
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox2.Text = Len(TextBox1.Text) Label2.Text = Button1.Text & "函数的结果" End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click TextBox2.Text = Trim(TextBox1.Text) Label2.Text = Button4.Text & "函数的结果" End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Dim a% a = InputBox("请输入重复出现的次数(必须为数字)", "StrDup函数") TextBox2.Text = StrDup(a, TextBox1.Text) Label2.Text = Button5.Text & "函数的结果" End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Dim b$ b = InputBox("输入查找字串", "InStr函数") TextBox2.Text = InStr(TextBox1.Text, b) Label2.Text = Button6.Text & "函数的结果" End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Dim c$, d$ c = InputBox("输入需要替换的字符串", "Replace函数") d = InputBox("输入替换后的字符串", "Replace函数") TextBox2.Text = Replace(TextBox1.Text, c, d) Label2.Text = Button7.Text & "函数的结果" End Sub Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click Dim m%, n% m = InputBox("输入从左开始取得位置(必须为数字)", "Mid函数") n = InputBox("输入要取得字符数(必须为数字)", "Mid函数") TextBox2.Text = Mid(TextBox1.Text, m, n) Label2.Text = Button8.Text & "函数的结果" End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub End Class
相关文章推荐
- MySQL学习17:运算符与函数之字符函数
- print函数输出(VB学习)
- [学习日记]vb.net里的两个重要的时间函数
- [学习记录]一些简单的字符截取函数
- C语言基础学习基本数据类型-字符专属的输入输出函数
- Python学习第四周第二次作业——函数
- C语言学习6 :指针的定义,指针类型要合法,指针要初始化,指针做函数参数,数组和指针的通用性,指针+1所代表的空间,void * 指针,交换函数中的指针,数组和字符型指针区别,字符型指针的应用,使用指针完成字符操作函数
- JavaScript中文字符验证的函数/正则
- 常用字符验证与过滤函数
- PHP学习笔记--字符串操作 作者:yezi33 字符串的整理: trim():除去字符串开头和末尾的空格或其他字符。函数执行成功时返回删除了string字符串首部和尾部空格的字符串,发生错误时返回空
- Matlab-vision包学习-Object Detection and Recognition-ocr函数字符识别
- orcal 中sql字符函数,数字函数,日期函数,转换函数学习,CASE和DECODE表达式学习
- 字符函数-(学习笔记)
- VB学习过程(二)VB的语法基础和常用的内部函数
- C语言学习笔记之字符I/O(getchar()函数与putchar()函数)
- <Python高级全栈开发工程师-1>学习过程笔记【181-184】正则表达式 <特殊字符><函数>
- python学习第四周:函数与递归函数·作业20141224
- getchar等字符函数使用--Points on C 学习(1)
- C Primer Plus学习 十一 ctype.h系列字符函数
- VB学习第四周续--四位整数逆序