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

CodePudding user response:



Why do you write label1 didn't results?

CodePudding user response:

reference 5 floor shaddockk reply:


Why do you write label1 didn't results?

That last sentence is to strText this variable, not strTemp!!!!!!

CodePudding user response:

refer to 6th floor Chen8013 response:
Quote: refer to the fifth floor shaddockk reply:



Why do you write label1 didn't results?

That last sentence is to strText this variable, not strTemp!!!!!!


Changed to also have no result,,,

CodePudding user response:

refer to 7th floor shaddockk response:
Quote: refer to the sixth floor Chen8013 response:

Quote: refer to the fifth floor shaddockk reply:



Why do you write label1 didn't results?

That last sentence is to strText this variable, not strTemp!!!!!!


Changed to also have no result,,,

Impossible, unless your TextBox1 is "empty"!

In addition, oneself before the Do loop set a breakpoint, then single-step tracking run it, and see where exactly is "incorrect",

CodePudding user response:

refer to the eighth floor Chen8013 response:
Quote: refer to 7th floor shaddockk response:

Quote: refer to the sixth floor Chen8013 response:

Quote: refer to the fifth floor shaddockk reply:



Why do you write label1 didn't results?

That last sentence is to strText this variable, not strTemp!!!!!!


Changed to also have no result,,,

Impossible, unless your TextBox1 is "empty"!

In addition, oneself before the Do loop set a breakpoint, then single-step tracking run it, and see where exactly is "incorrect",
it is ok, but in the end the result of the export, RRWWRRT such as input, the output is RWT

CodePudding user response:

references 9 f shaddockk response:
Quote: reference

........


It is possible, but finally the result of the export, RRWWRRT such as input, the output is RWT


Shouldn't be the result?

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related