shaman Posted September 26, 2008 Share Posted September 26, 2008 Hello. I am having a problem with one of my programs... if a user puts in multiple spaces in a text field, then they get the error:StartIndex cannot be less than zero. Parameter name: startIndexThis was not a problem in classic ASP. Why is it acting this way? The code format is exactly the same:Dim searchString = server.htmlencode(request.querystring("search")searchString = Split(searchString," ")Can someone help me please? Link to comment Share on other sites More sharing options...
aspnetguy Posted September 26, 2008 Share Posted September 26, 2008 String.Split only accepts 1 argument, the character to split by.Try this Dim splitArray() As StringsplitArray = searchString.Split(" ") EDIT: Nevermind look here and make sure oyu have things right http://msdn.microsoft.com/en-us/library/6x627e5f(VS.80).aspx Link to comment Share on other sites More sharing options...
shaman Posted September 27, 2008 Author Share Posted September 27, 2008 Nevermind I simply ran a regex replace to remove multiple whitespaces, then used the trim method to get rid of any excess spaces that would cause my sitesearch a problem... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.