Home > Software engineering > Vb to occur in the string and adjacent repeated letters, for different uppercase and lowercase lette
Vb to occur in the string and adjacent repeated letters, for different uppercase and lowercase lette
Time:09-17
Homework assignments, ask bosses
CodePudding user response:
The first question on the left to start once it is good to take a character for the replace The second to each character comparison
CodePudding user response:
Can be more specific?
CodePudding user response:
Can be more specific?
CodePudding user response:
I haven't installed the.net programming environment, give you a VB6 code reference, The "grammar" with a little different: VB.NET Such as Mid () function, you are in the.net can use instead of "string. The SubString", Specific details I don't know, anyway, in the development environment is "a see will know that, the difference you change yourself,
Option Explicit
Private Sub Command1_Click () Dim strText As String Dim strTemp As String Dim strChar As String
StrTemp=Text1. Text StrText="" Do If (" "=strTemp) Then Exit the Do StrChar=Mid $(strTemp, 1, 1) StrText=strText & amp; StrChar StrTemp=Replace (strTemp strChar, "") Loop Me. Cls Me. Print strText 'your homework is assigned to a Label End Sub
Private Sub Command2_Click () Dim strText As String Dim strChar As String Dim i& P& , w As Long
StrText=Text1. Text W=Len (strText) P=0 & amp; : I=1 & amp; Do If (I & gt; W) Then Exit the Do StrChar=Mid $(strText, I, 1) For I=1 & amp; + I To w If (strChar & lt;> Mid $(strText, I, 1)) Then the Exit For Next P=1 & amp; + p Mid $(strText, p)=strChar Loop Me. Cls Me. Print Left $(strText, p) 'in your homework is assigned to a Label End Sub