Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Delete until end of line

Reply
Thread Tools

Delete until end of line

 
 
Joey Martin
Guest
Posts: n/a
 
      04-19-2007
Sample:
sql="select * from table order by id"

How do I look at the query statement and remove all the characters
starting with "order by" and remove all remaining characters in that
line?





*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
 
 
 
Subrato
Guest
Posts: n/a
 
      04-19-2007
On Apr 19, 7:53 am, Joey Martin <(E-Mail Removed)> wrote:
> Sample:
> sql="select * from table order by id"
>
> How do I look at the query statement and remove all the characters
> starting with "order by" and remove all remaining characters in that
> line?
>
> *** Sent via Developersdexhttp://www.developersdex.com***


You could do a string search and remove everything after the word
order till you encounter the last double quote ..


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      04-19-2007
Joey Martin wrote:
> Sample:
> sql="select * from table order by id"
>
> How do I look at the query statement and remove all the characters
> starting with "order by" and remove all remaining characters in that
> line?
>
>

Two techniques:
1. InStr() combined with Left()

sql=Left(sql, InStr(sql,"order by") - 1)

2. Regular Expression
left as exercise for other posters

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 
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
READ THIS MESSAGE UNTIL THE END! mlopez1010@gmail.com Java 2 09-05-2007 08:53 PM
delete chars until end of line RicK C++ 2 07-20-2007 10:07 AM
List of tables, nowrap until end of available width Sjaakie HTML 4 03-22-2005 10:52 AM
Digimarc special offer (Only until end of year) Aaron Queenan Digital Photography 10 12-31-2003 04:13 AM
UNTIL THE END OF THE WORLD DVD announced Moviezzz DVD Video 2 09-08-2003 02:14 PM



Advertisments