VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get text item within text items concated to one string

by Avital (2 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Tue 8th August 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Get text item within text items concated to one string

Rate Get text item within text items concated to one string



'**************************************************************
'* Perpuse : get text item within text items concated to one string
'* Author  : Avital
'* Example : FindTextItem("AA,BB,CC",2) -> BB
'**************************************************************
   Dim i As Integer
   Dim iPos As Integer
   
   'look for item
   For i = 1 To iItem - 1
      iPos = InStr(sText, sSup)
      If iPos <> 0 Then
         sText = Mid$(sText, iPos + 1)
      Else
         Exit For
      End If
   Next i
   
   If i = iItem Then
      'item is found, cut sSup if necessary
      iPos = InStr(sText, sSup)
      If iPos <> 0 Then sText = Mid$(sText, 1, iPos - 1)
   Else
      'item not found
      sText = ""
   End If
   FindTextItem = sText
End Function


Download this snippet    Add to My Saved Code

Get text item within text items concated to one string Comments

No comments have been posted about Get text item within text items concated to one string. Why not be the first to post a comment about Get text item within text items concated to one string.

Post your comment

Subject:
Message:
0/1000 characters