Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,037 questions

40,822 answers

573 users

How to get the last space position in a string with VB.NET

2 Answers

0 votes
Imports System
 
Public Class Test
    Public Shared Sub Main()
        Dim s As String = "c# javascript php c c++ python vb.net"
        Dim last_space_pos As Integer = s.LastIndexOf(" ") 
 
        Console.WriteLine(last_space_pos)
 
    End Sub
End Class
 
 
 
' run:
' 
' 30
'

 





answered Sep 9, 2019 by avibootz
0 votes
Imports System
 
Public Class Test
    Public Shared Sub Main()
        Dim s As String = "c# javascript php c c++ python vb.net"
        Dim last_space_pos As Integer = s.LastIndexOf(" ") 
 
        Console.WriteLine(last_space_pos)
        
        Console.WriteLine(s(last_space_pos - 1))
        Console.WriteLine(s(last_space_pos + 1))

    End Sub
End Class
 
 
 
' run:
' 
' 30
' n
' v
'

 





answered Sep 9, 2019 by avibootz
...