重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
语法错误,没有存储函数的返回值。
成都创新互联专注为客户提供全方位的互联网综合服务,包含不限于网站制作、成都网站建设、吉安网络推广、小程序开发、吉安网络营销、吉安企业策划、吉安品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;成都创新互联为所有大学生创业者提供吉安建站搭建服务,24小时服务热线:13518219792,官方网址:www.cdcxhl.com
temp.Replace("111", "22")
这个函数方法返回修改后的结果,并不修改参数变量本身,也就是按值传递,而不是按地址传递,正确用法:
temp=temp.Replace("111", "22")
这个简单,截取字符串就行了
TextBox1.Text = TextBox1.Text.Substring(0, 2) "BB" TextBox1.Text.Substring(4, 2)
文本框 TextBox1
上一条 Button1
下一条 Button2
修改 Button3
Imports System.IO
Public Class Form1
Dim currIndex As Integer = 0
Dim s2 As List(Of String) = New List(Of String)
Dim s As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
s = File.ReadAllText(Application.StartupPath "\txt.txt")
Dim s1 As String() = s.Split("@")
For i As Integer = 0 To s1.Length - 1
If s1(i).Trim() "" Then
s2.Add("@" s1(i))
End If
Next
TextBox1.Text = s2(0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
currIndex = currIndex + 1
If currIndex s2.Count - 1 Then
MsgBox("已经是最后条了")
Return
End If
TextBox1.Text = s2(currIndex)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
currIndex = currIndex - 1
If currIndex 0 Then
MsgBox("已经是第一条了")
Return
End If
TextBox1.Text = s2(currIndex)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
s2(currIndex) = TextBox1.Text
s = ""
For i As Integer = 0 To s2.Count - 1
s = s2(i)
Next
File.WriteAllText(Application.StartupPath "\txt.txt", s)
End Sub
End Class
变通的方法:
首先 把List 替换为一个其他的字符串如OOO,要全字匹配替换。然后替换List为fList,然后再把OOO替换为List。
x="a[11dsfsf]b"
b=x.lastindexof("]")
a=x.indexof("[")
x=x.substring(0,a) "0" x.substring(b)
将dll以文件方式以UTF-8的方式读入,然后接下来就替换字符串就可以了嘛
C#:
using System.IO;
...
string text;
text=File.ReadAllText(FilePath, Encoding.UTF8);
text.Replace("...","...");
...
-------------------------
还要谢谢你,不然我还不知道是UTF-8的编码格式,我有一个验证的问题可以解决了。