hazejean Posted October 5, 2003 Posted October 5, 2003 I am using split function to check for subforms called in a text string. The subform names are surrouned by brackets. ex [form1][form2] I split using left bracket, then right bracket to get name. However some text strings have no subforms. How can I test for non-existance of the left bracket.? If no brackets I want to skip call to subform. thanks Quote
Moderators Robby Posted October 5, 2003 Moderators Posted October 5, 2003 You can use RegEx (Regular Expressions) or use IndexOf,Split and SubString methods of the String object. One way to is to Split on the right bracket and if the first character of each element is not a left bracket then it wouldn't be a form. You get the idea.... if not let me know. Quote Visit...Bassic Software
hazejean Posted October 5, 2003 Author Posted October 5, 2003 The problem I have is when there is no left or right bracket. In that case I want to do nothing. Need way to check split results when the split charater is absent. Thanks. Quote
Moderators Robby Posted October 5, 2003 Moderators Posted October 5, 2003 Once you have spilt on brackets then check each element for spaces. Quote Visit...Bassic Software
hazejean Posted October 5, 2003 Author Posted October 5, 2003 will try...but when I have no brackets...for some reason it was not returning blank in elements Thanks Quote
hog Posted October 17, 2003 Posted October 17, 2003 Have you thought of using the InStr function to check for the existence of brackets first? Quote My website
Moderators Robby Posted October 17, 2003 Moderators Posted October 17, 2003 Or IndexOf since we're using .NET :) Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.