A More Enhanced Right() Function

A More Enhanced Right() Function

Normally, the Right() Function VB returns only the Length specified from the End. If you want to extract the Right portion from any index of the String you have to play with the Mid() Function. It’s very tedious to write a Mid() function for each of the above functionalities. The solution is to use the following function to extract the right portion of the string from any specified position.

 Private Function MidR(strSource As String, StartIndex As Integer, LengthAs Integer)Dim StartPositon As Integer    If StartIndex > Len(strSource) Then StartIndex = Len(strSource)    StartPositon = StartIndex - Length + 1    If StartPositon > 0 Then        MidR = Mid(strSource, StartPositon, Length)    Else        MidR = Mid(strSource, 1, StartIndex)    End IfEnd FunctionUsage: StrValue=MidR("123456",5,2)Returns : 45

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular