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,128 questions

40,777 answers

573 users

How to use DirectCast to cast Object to a String in VB.NET

1 Answer

0 votes
Module Module1

    Sub Main()

        Dim s As String = "VB.NET"
        Dim o As Object = s

        Dim tc = DirectCast(o, String)

        Console.WriteLine(tc)
        Console.WriteLine(tc.Length)

    End Sub

End Module

' run:
' 
' VB.NET
' 6

 





answered Sep 28, 2018 by avibootz

Related questions

1 answer 83 views
2 answers 97 views
2 answers 93 views
93 views asked Dec 2, 2020 by avibootz
4 answers 140 views
...