sasha85
asked on
split? left? right?
i got rs("x") with lots of numbers divided with comma(,)
*ends with comma too
3434,4343,5456,676556565,6 5,
how i can print them with space between them?
like this:(and to kill the last comma)
3434 ,4343 ,5456 ,676556565 ,65 ,
*ends with comma too
3434,4343,5456,676556565,6
how i can print them with space between them?
like this:(and to kill the last comma)
3434 ,4343 ,5456 ,676556565 ,65 ,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
well that's what i'm talking about...replace function is great!:)
hielo, how are you?:)
i understand deathtospam's code now but,
what do you think about deathtospam's code?
i mean what is better-to replace from the begining or processing the rs("x") as deathtospam did...
hielo, how are you?:)
i understand deathtospam's code now but,
what do you think about deathtospam's code?
i mean what is better-to replace from the begining or processing the rs("x") as deathtospam did...
>>...replace function is great!:)
It sure is
>>hielo, how are you?:)
Super
>>what is better-to replace from the begining or processing the rs("x") as deathtospam did
I find the "Replace" option easier to understand/maintain. If the rs("x") values is "consistent" , processing the other way is kind of an overkill, espcially since it saves the value of Split every time it is called. The way I see it, don't consume extra memory resources if it is not needed.
It sure is
>>hielo, how are you?:)
Super
>>what is better-to replace from the begining or processing the rs("x") as deathtospam did
I find the "Replace" option easier to understand/maintain. If the rs("x") values is "consistent" , processing the other way is kind of an overkill, espcially since it saves the value of Split every time it is called. The way I see it, don't consume extra memory resources if it is not needed.
ASKER
Replace( Left( rs("x"),Len(rs("x"))-1 ), ",", " ,")
runs on the all rs("x")
or i still need to split and replace every part?
runs on the all rs("x")
or i still need to split and replace every part?
>>or i still need to split and replace every part?
No Splitting necessary. I am assuming rs("x") is some db field. As an example, you would use it as follows:
'assuming you queried the db and the result is in rs
while Not rs.eof
Response.Write Replace( Left( rs("x"),Len(rs("x"))-1 ), ",", " ,")
rs.moveNext
wend
No Splitting necessary. I am assuming rs("x") is some db field. As an example, you would use it as follows:
'assuming you queried the db and the result is in rs
while Not rs.eof
Response.Write Replace( Left( rs("x"),Len(rs("x"))-1 ), ",", " ,")
rs.moveNext
wend
ASKER
i just tried that...i got plain page...
my rs("x") was 232,343445,565656,35324,24 32,
my rs("x") was 232,343445,565656,35324,24
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
aa ok...my mistake...
thank you!
thank you!
ASKER
i am kind of lost with yours:
strValues = Trim(rs("x") & "") ?
sValue = Trim(arrValues(iIndex)) ?