While IsNumeric(s.Substring(s.Length - 1)) s= s.Substring(0, s.Length - 1) End While
My method and the .net version don't do that, they just create the final string once.
While I haven't "looked under the hood" of the assignment, I wonder if that isn't the case. The reason I suspect that a new string is not being created, but perhaps just terminated (as in C), or a count changed, as in a BString, is that changing to the following code makes the times more widely different. The following code, on my machine, gives times of about 36 vs. 10 ms, as opposed to the previous 30 vs. 10 ms.
Dim s As String = "1234567890hello123498there176455" Dim sw As New Stopwatch Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim idx As Integer = s.Length - 1 sw.Restart() For i = 0 To 100000 While IsNumeric(s.Substring(idx)) ' same result using (idx,1) for SubString args. idx -= 1 End While s = s.Substring(0, idx + 1) Next Debug.Print(sw.Elapsed.TotalMilliseconds.ToString) sw.Restart() For i = 1 To 100000 s = s.TrimEnd("0123456789".ToCharArray) Next Debug.Print(sw.Elapsed.TotalMilliseconds.ToString) End Sub