Aug 31, 2006 #1 Kendel Programmer Apr 24, 2002 1,512 US Hi All: How do I seperate the left & right of the string? My string looks like this: <%Str1, Str2%> I don't know the lenght of Str1 or Str2. Thanks.
Hi All: How do I seperate the left & right of the string? My string looks like this: <%Str1, Str2%> I don't know the lenght of Str1 or Str2. Thanks.
Aug 31, 2006 #2 rjoubert Programmer Oct 2, 2003 1,843 US Code: YourString = "<%Str1, Str2%>" strLeft = Left(YourString, InStr(1, YourString, ",", 1) - 1) strRight = Mid(YourString, InStr(1, YourString, ",", 1) + 1, Len(YourString)) Upvote 0 Downvote
Code: YourString = "<%Str1, Str2%>" strLeft = Left(YourString, InStr(1, YourString, ",", 1) - 1) strRight = Mid(YourString, InStr(1, YourString, ",", 1) + 1, Len(YourString))
Aug 31, 2006 #3 Sheco Programmer Jan 3, 2005 5,457 US You could also use the Split() function to create an array from the string, with the comma as the delimitter. That is probably overkill for just 2 values but for 3 or more it is a good idea. Upvote 0 Downvote
You could also use the Split() function to create an array from the string, with the comma as the delimitter. That is probably overkill for just 2 values but for 3 or more it is a good idea.
Sep 1, 2006 Thread starter #4 Kendel Programmer Apr 24, 2002 1,512 US Thank you guys. Both solutions work for me but I'm uisng rjoubert's. Thanks again. Upvote 0 Downvote