前のデータと後のデータの違いを返すことができるメソッドを実行しています
Dim dataBefore As String = "Name:Alice,Age:30,Sex:Male"
Dim dataAfter As String = "Name:Alice,Age:20,Sex:Female"
mtdCompare2String(dataBefore,dataAfter)
Public Shared Function mtdCompare2String(ByVal sBefore As String, ByVal sAfter As String) As String
//what i try to do before, supposing my loop should start over here but i failed,
//so i just removed the loop, i need someone to correct me =(
Dim intBefore As Integer = sBefore.IndexOf(",")
Dim intAfter As Integer = sAfter.IndexOf(",")
Dim sBefore As String = sBefore.SubString(0,intBefore)
Dim sAfter As String = sAfter.SubString(sAfter.IndexOf(":"),intAfter)
Dim sb As StringBuilder
sb.append(sBefore,sAfter)
return sb.toString
End Function
期待される結果
年齢:30>20、性別:男性>女性