What is the MID function?
Printable View
What is the MID function?
I don't mean to be evasive or unhelpful - but have a look at msdn's docs for MID. If you still have trouble then I'm sure we'd be pleased to help.
HD
Mid allows you to take a portion of a string starting at certain position for specified length.
Maybe you can do a search on MID
I would answer , but try to use the forum to the max.
Sorry about that... I have a project for a class to create a robot game using the MID function, and a friend of mine asked about it on here, and everyone kept telling her not to use MID because there were better ways to do it. It's part of the assignment. *fustration*. :( I probably should have asked in that string. Sorry.
This you can do with the Mid functionVB Code:
' you can use the mid function to change a existing string Dim MyString MyString = "The dog jumps" ' Initialize string. Mid(MyString, 5, 3) = "fox" ' MyString = "The fox jumps". Mid(MyString, 5) = "cow" ' MyString = "The cow jumps". Mid(MyString, 5) = "cow jumped over" ' MyString = "The cow jumpe". Mid(MyString, 5, 3) = "duck" ' MyString = "The duc jumpe". ' or to substract something out of a string MyString = "The dog jumps" ' Initialize string. MsgBox "Who " & Mid$(MyString, 9) & " " & Mid$(MyString, 1, 8) & "?"
Place the code in a event and check on the value of MyString