Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > split question

Reply
Thread Tools

split question

 
 
peashoe
Guest
Posts: n/a
 
      06-15-2006
Can anyone help me with a simple split problem. I've never done it
before and I have no clue.

I have value sSearch = Lastname Firstname

I need to split it into two separate field:
sLast = Lastname
sFirst = Firstname

I tried
arrSearch = split(sSearch, " " )
but how do I actually get the values?

thanks in advance for your help
Lisa

 
Reply With Quote
 
 
 
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      06-15-2006
for i = 0 to ubound(arrSearch)
response.write i & " = " & arrSearch(i) & "<br>"
next


"peashoe" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Can anyone help me with a simple split problem. I've never done it
> before and I have no clue.
>
> I have value sSearch = Lastname Firstname
>
> I need to split it into two separate field:
> sLast = Lastname
> sFirst = Firstname
>
> I tried
> arrSearch = split(sSearch, " " )
> but how do I actually get the values?
>
> thanks in advance for your help
> Lisa
>



 
Reply With Quote
 
 
 
 
peashoe
Guest
Posts: n/a
 
      06-15-2006
thanks Aaron,
but I don't need to display the data. I just need to grab it so I can
do a sql select to get other data. Therefore, I need to actually have
two values:

sLast and sFirst...

Make sense?
~L~

 
Reply With Quote
 
Aaron Bertrand [SQL Server MVP]
Guest
Posts: n/a
 
      06-15-2006
"peashoe" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> thanks Aaron,
> but I don't need to display the data. I just need to grab it


Okay, so don't response write, I was just showing you how to quickly see the
data after the split.


 
Reply With Quote
 
peashoe
Guest
Posts: n/a
 
      06-15-2006
the problem was I didn't know how to do it - but I found the answer on
here anyway:

arrSearch = split(sSearch, " ")

this is what I didn't know how to do...
sLast = arrSearch(0)
sFirst = arrSearch(1)

Thanks~!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a split is not a split Dumbell Computer Support 3 03-09-2009 10:45 PM
String#split(/\s+/) vs. String#split(/(\s+)/) Sam Kong Ruby 5 08-12-2006 07:59 PM
How can I split database results with ExecuteReader and Split? needin4mation@gmail.com ASP .Net 2 05-05-2006 10:36 PM
split on '' (and another for split -1) trans. (T. Onoma) Ruby 10 12-28-2004 06:36 AM
Small inconsistency between string.split and "".split Carlos Ribeiro Python 11 09-17-2004 05:57 PM



Advertisments