Hi
What is difference between Mid function and Mid Statement ?
Mid function and Mid Statement
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Chintan RathodRank #516 · 4.8K reputationPosted May 30, 2012, 6:37 AM EDT
Mid function returns the characters while the Mid statement replaces the characters.
Example,
Sub Main()
Dim testString = "TestingStringHere"
Mid(testString, 5) = "..Bore.." ' it is Mid statement
Console.WriteLine(testString) ' returns Test..Bore..gHere - its replacing string
Dim midstring As String = "TestingStringHere"
midstring = Mid(midstring, 8, 6) ' it is Mid function
Console.WriteLine(midstring) ' returns string - its just extracting string
End Sub
Thanks & Regards
-----------------
Chintan Rathod
VulpesRank #55 · 29.2K reputationPosted May 30, 2012, 6:47 AM EDT