vb.net - How to make a program that would detect the same characters within two strings -
So I created it, but when I put a string, it only detects one character and it enters string Do not convert in short case
String dim j as dim back read, readme 2, I compare the integer readme as an integer ream = text box. Text Read 2 = Text Box. Text readme Toolless Substring (I, readme.length) readme2 .louur. Js = 0 readme2 for readme.length for substrings (j, readme 2. langha) i = 0 Langi if readme = readme2 then next = 1 end compare Next Next label 4.Text = 'Compare center code here'
Wire is irreversible You can not apply a method to a string and expect that string to change in response to the internal functions of that method.
You need to reassign the result of action on the same string that you used to call method
readme = readme.ToLower () readme2 = readme2 .toLower () The second part of your question is more confusing, are you trying to count the number of equal characters in the same position?
In that case your loop should be
dim maxLenToCheck = Math.Min (readme.Length, readme2.Length) maxLenToCheck for I = 0 - 1 if readme ( I) = readme2 (i) then compare = 1 end if next In that loop you always compare 1, the correct syntax for increasing the comparison variable
compare + = 1 After your comment below, I think your loop should be written
compare slow = Readme.Length for 0 I = 0 - 1 for j = 0 to readme2. If there is no readme (i) = readme (i) = readme2 (j) and also _ four is not equal to ISWhiteSpace (readme (i)) then compare = 1 end if next next
Comments
Post a Comment