RE: Last Question...

View: New views
6 Messages — Rating Filter:   Alert me  

RE: Last Question...

by Robert Harrison-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

 
Man, I'm just full of questions today. You all have been great.
Obviously string manipulation is not by strongest point...

So now I've a reasonable piece of the string from the query, striped of
HTML. I want to display the string but I don't want the display to end
it the middle of a word. I want it to end on a space.
 
Before I write some fancy loop program that counts spaces, gets me the
position of the last space, etc., I'm thinking there's got to be an
easier way.

I'd be happy if I can either 1) display the whole string terminating on
the last space, or 2) display the string teminating on the X occurance
of a space (this would give me the first X number of words).

Does anyone know the easy way?

Thanks



Robert B. Harrison
Director of Interactive Services, Ext. 205

155 East Main Street
Smithtown, NY 11787
P (631) 361-4400
F (631) 361-6400
http://www.linx.com
 
 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:25:2065
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/25
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:25
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.25
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Parent Message unknown RE: Last Question...

by Cook, Scott :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Reverse the string, find the first blank, substring it from that point+1, then reverse it again.

-----Original Message-----
From: Robert Harrison [mailto:RobertH@...]
Sent: Wednesday, November 23, 2005 12:46 PM
To: NYCFUG
Subject: RE: Last Question...


 
Man, I'm just full of questions today. You all have been great.
Obviously string manipulation is not by strongest point...

So now I've a reasonable piece of the string from the query, striped of
HTML. I want to display the string but I don't want the display to end
it the middle of a word. I want it to end on a space.
 
Before I write some fancy loop program that counts spaces, gets me the
position of the last space, etc., I'm thinking there's got to be an
easier way.

I'd be happy if I can either 1) display the whole string terminating on
the last space, or 2) display the string teminating on the X occurance
of a space (this would give me the first X number of words).

Does anyone know the easy way?

Thanks



Robert B. Harrison
Director of Interactive Services, Ext. 205

155 East Main Street
Smithtown, NY 11787
P (631) 361-4400
F (631) 361-6400
http://www.linx.com
 
 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:25:2067
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/25
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:25
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.25
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Parent Message unknown RE: Last Question...

by Andrew Thielen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Taken from cflib, don't remember who did it:

function abbreviate(string,len) {
                var newString = REReplace(string, "<[^>]*>", " ",
"ALL");
                var lastSpace = 0;
                newString = REReplace(newString, " \s*", " ", "ALL");
                if (len(newString) gt len) {
                        newString = left(newString, len-2);
                        lastSpace = find(" ", reverse(newString));
                        lastSpace = len(newString) - lastSpace;
                        newString = left(newString, lastSpace) & "
&##8230;";
                }
                return newString;
        }

-----Original Message-----
From: Robert Harrison [mailto:RobertH@...]
Sent: Wednesday, November 23, 2005 12:46 PM
To: NYCFUG
Subject: RE: Last Question...

 
Man, I'm just full of questions today. You all have been great.
Obviously string manipulation is not by strongest point...

So now I've a reasonable piece of the string from the query, striped of
HTML. I want to display the string but I don't want the display to end
it the middle of a word. I want it to end on a space.
 
Before I write some fancy loop program that counts spaces, gets me the
position of the last space, etc., I'm thinking there's got to be an
easier way.

I'd be happy if I can either 1) display the whole string terminating on
the last space, or 2) display the string teminating on the X occurance
of a space (this would give me the first X number of words).

Does anyone know the easy way?

Thanks



Robert B. Harrison
Director of Interactive Services, Ext. 205

155 East Main Street
Smithtown, NY 11787
P (631) 361-4400
F (631) 361-6400
http://www.linx.com
 
 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
All-in-one: antivirus, antispam, firewall for your PC and PDA. Buy Trend Micro PC-cillin Internet Security
http://www.houseoffusion.com/banners/view.cfm?bannerid=60

Message: http://www.houseoffusion.com/lists.cfm/link=i:25:2066
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/25
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:25
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.25
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Parent Message unknown RE: Last Question...

by Andrew Thielen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://www.cflib.org/udf.cfm?ID=1106 

-----Original Message-----
From: Robert Harrison [mailto:RobertH@...]
Sent: Wednesday, November 23, 2005 12:46 PM
To: NYCFUG
Subject: RE: Last Question...

 
Man, I'm just full of questions today. You all have been great.
Obviously string manipulation is not by strongest point...

So now I've a reasonable piece of the string from the query, striped of
HTML. I want to display the string but I don't want the display to end
it the middle of a word. I want it to end on a space.
 
Before I write some fancy loop program that counts spaces, gets me the
position of the last space, etc., I'm thinking there's got to be an
easier way.

I'd be happy if I can either 1) display the whole string terminating on
the last space, or 2) display the string teminating on the X occurance
of a space (this would give me the first X number of words).

Does anyone know the easy way?

Thanks



Robert B. Harrison
Director of Interactive Services, Ext. 205

155 East Main Street
Smithtown, NY 11787
P (631) 361-4400
F (631) 361-6400
http://www.linx.com
 
 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:25:2068
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/25
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:25
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.25
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Parent Message unknown RE: Last Question...

by Robert Harrison-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> http://www.cflib.org/udf.cfm?ID=1106 


That is exactly what I was trying to do all along.

Thank You.
 
Robert B. Harrison
Director of Interactive Services, Ext. 205

155 East Main Street
Smithtown, NY 11787
P (631) 361-4400
F (631) 361-6400
http://www.linx.com
 
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:25:2069
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/25
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:25
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.25
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Parent Message unknown RE: Last Question...

by Wolf, Yonah :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robert,

 Alternatively, using SQL:

        select left(my_converted_text,charindex(my_converted_text,' ',275)

This will return your string up to the first space after 275 characters.

 


Yonah Wolf
Development Project Manager
United Jewish Communities
111 8th Ave, Suite 11E
New York, NY 10011
V: 212.284.6550 / F: 212.284.6819
E: yonah.wolf@... / W: http://www.ujc.org
Live Generously.?  It does a world of good.

-----Original Message-----
From: Robert Harrison [mailto:RobertH@...]
Sent: Wednesday, November 23, 2005 12:46 PM
To: NYCFUG
Subject: RE: Last Question...

 
Man, I'm just full of questions today. You all have been great.
Obviously string manipulation is not by strongest point...

So now I've a reasonable piece of the string from the query, striped of HTML. I want to display the string but I don't want the display to end it the middle of a word. I want it to end on a space.
 
Before I write some fancy loop program that counts spaces, gets me the position of the last space, etc., I'm thinking there's got to be an easier way.

I'd be happy if I can either 1) display the whole string terminating on the last space, or 2) display the string teminating on the X occurance of a space (this would give me the first X number of words).

Does anyone know the easy way?

Thanks



Robert B. Harrison
Director of Interactive Services, Ext. 205

155 East Main Street
Smithtown, NY 11787
P (631) 361-4400
F (631) 361-6400
http://www.linx.com
 
 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:25:2070
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/25
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:25
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.25
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54