The text of this article is not in this database — only its details are. Read it on the old site: Working with Strings in VB.NET
8 Comments
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Working with Strings in VB.NET
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
Sandra LeaPosted Jul 21, 2011, 11:31 AM
Hi I'm trying to write a code to concatenate fields and I seem to be having a problem The guidelines are as follows "Write the code for the “Put Together” button click event. The subroutine should call a function PutFieldsTogether. The PutFieldsTogether function should get the text from all the txtField# textboxes and create a string by concatenating the fields together with comma&space in between each field. The PutFieldsTogether function should return this string. The “Put Together” button click subroutine should then update the text in txtRecord with the returned string. The “Put Together” button click subroutine should also clear the txtField# textboxes." Here's the what I have written but it won't run Private Sub btnPutTogether_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPutTogether.Click Dim str1 As String = txtField1.Text Dim str2 As String = txtField2.Text Dim str3 As String = txtField3.Text Dim str4 As String = txtField4.Text Dim str5 As String = txtField5.Text Dim str6 As String = txtField6.Text Dim strJoinRecord As String strJoinRecord = PutFieldsTogether(str1, str2, str3, str4, str5, str6) End Sub Private Function PutFieldsTogether(ByVal str1 As String, ByVal str2 As String, ByVal str3 As String, ByVal str4 As String, ByVal str5 As String, ByVal str6 As String) As String Dim strJoinRecord As String Dim Fields() As String = New String() {str1, str2, str3, str4, str5, str6} strJoinRecord = String.Join(",", Fields) strJoinRecord = txtRecord.Text Return strJoinRecord End Function
StevePosted Oct 2, 2010, 6:21 AM
Is there a way to count the number of replacements when globally replacing one string with another in VB.NET?
massanda mamboleoPosted Sep 24, 2010, 5:14 AM
Hello, could you please advise on how to remove spaces between position 7394 and 248045? many thanks, Massanda
sonia boobPosted Jun 16, 2010, 3:54 AM
Hi, I have xls sheet, i want code to replace one string to blank.pls help me out soon
zaz azaeditedPosted May 26, 2010, 7:18 AMEdited Aug 11, 2010, 11:51 AM
d
prasanna kumarPosted Mar 3, 2010, 4:13 AM
how to write array of stringbuilder?
satheesh kumar kgPosted Jan 28, 2008, 3:07 AM
string builder programs doesn't work.when compiling it displays compiling errors.