从文本框中删除字符串变量 [英] removing string variable from textbox

查看:97
本文介绍了从文本框中删除字符串变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


在我的项目中,我在该文本框中有一个文本框,我可能具有类似"A1 A2 A3 A4 A5"的值,我想从该文本框中删除A3值,请帮助我该怎么做或给我提供示例代码

hi all


in my project i have textbox in that textbox i may have values like "A1 A2 A3 A4 A5", i want remove the A3 value from that textbox please help me how to do or give me sample code

推荐答案

使用String.Replace.

http://msdn.microsoft.com/en-us/library/system.string. replace.aspx [^ ]

[更新]
---------

为了回应您的评论,要求提供示例代码,这是我上面链接到的MSDN文档中的男女同段代码:

Use String.Replace.

http://msdn.microsoft.com/en-us/library/system.string.replace.aspx[^]

[Update]
---------

In response to your comment asking for sample code, here''s the coede snippet from the MSDN documentation I linked to above:

Imports System

Public Class ReplaceTest

    Public Shared Sub Main()
        Dim errString As String = "This docment uses 3 other docments to docment the docmentation"

        Console.WriteLine("The original string is:{0}'{1}'{0}", Environment.NewLine, errString)

        ' Correct the spelling of "document".
        Dim correctString As String = errString.Replace("docment", "document")

        Console.WriteLine("After correcting the string, the result is:{0}'{1}'", Environment.NewLine, correctString)
    End Sub
End Class


这篇关于从文本框中删除字符串变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆