I have a function: Private Function getbyte(s As String, ByVal place As Integer) As StringIf place < Len(s) Thenplace = place + 1getbyte = Mid(s, place, 1)Elsegetbyte = End IfEnd FunctionFor extracting a character at a particular place in a string, how can I shorten this or any alternate for the same purpose? 
Extract a character at particular place in a string
strings;vb.net;vba;vb6
According to MSDN, this function is already implemented:' Code from MSDN'Dim myString As String = ABCDE Dim myChar As Char ' The value of myChar is D.myChar = myString.Chars(3)A review of your codePlease indent your code.I would choose another, more meaningful name for your function: getCharAt or getByteFromString. It is now clear that the function operates on a string.I would use the clearer parameter name str instead of s.Compress:place = place + 1getbyte = Mid(s, place, 1)' change togetbyte = Mid(s, place + 1, 1)The first version is definitely not wrong or ugly, but why use an extra line if we could express the same logic in the same clear manner?You could use If to shorten your code:Private Function getbyte(str As String, ByVal place As Integer) As String  getbyte = If(place < Len(str), Mid(str, place + 1, 1), )End Function