How to find the index of the last space in string with VB.NET

1 Answer

0 votes
Imports System

Public Class Program
	Public Shared Sub Main()
        Dim s As String = "c# vb.net java c c++ python java"
		
        Dim ch As Char = " "c
		
        Dim last_index As Integer = s.LastIndexOf(ch)
		
        Console.WriteLine(last_index)
    End Sub
End Class




' run:
'
' 27
'

 



answered Feb 16, 2022 by avibootz
...