by Samuelanre (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sat 3rd May 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Break a set of strings separated by a single space into the individual strings combined.
'by a single space into the individual strings combined.
'An example is when you have combined surname, firstname,
'and lastname into a single string separated by a single space, but now
'you want to break them apart again.
'VERY USEFUL WHEN WORKING WITH A DATABASE WHERE THE NEED MAY ARISE
' TO COMBINED DIFFERENT STRINGS, WHICH HAS TO BE SPLIT AGAIN (FOR THE
' PURPOSE OF UPDATING THE INDIVIDUAL STRING BACK TO THE DATABASE
' YOU CAN CONTACT ME FOR FURTHER CLARIFICATION ([email protected])
'Example:
'surname=strSName, firstname=strFname,MiddleName=strMname
Dim strSName as String, strFname as String, strMname as String, br1 As String
'theString is the combined string
strSName = Mid(theString, 1, InStr(1, theString, " "))
br1 = Mid(theString, Len(strSName) + 1, Len(theString) - Len(strSName))
strFname = Mid(br1, 1, InStr(1, br1, " "))
strMname = Mid(br1, Len(strFname) + 1, Len(br1) - Len(strFname))
No comments have been posted about Break a set of strings separated by a single space into the individual strings combined.. Why not be the first to post a comment about Break a set of strings separated by a single space into the individual strings combined..