Advertisement
phamchin

Tim chuoi xuan hien

Feb 13th, 2023
1,640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.34 KB | None | 0 0
  1. 'This function to find a position of a string appear n time in a string and return a number
  2.  
  3. Function FindN(sFindWhat As String, _
  4. sInputString As String, N As Integer) As Integer
  5. Dim J As Integer
  6. Application.Volatile
  7. FindN = 0
  8. For J = 1 To N
  9. FindN = InStr(FindN + 1, sInputString, sFindWhat)
  10. If FindN = 0 Then Exit For
  11. Next
  12. End Function
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement