Code Snippet for VB’s Split() Function

By | 2002-04-19

This is a one line code snippet to extract any section of a string using the Split() function. You can actually return the indexed section right in the same line as the Split() without having to assign the Split() to an array.

Original Author: Rocky Clark (Kath-Rock Software)

Code

Place this line in your immediate window and run it. It will return "Test5".
Print Split("Test0 Test1 Test2 Test3 Test4 Test5 Test6", " ")(5)

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.