Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 13th, 2003, 12:27 PM
Authorized User
 
Join Date: Oct 2003
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ittorget
Default Help with letters

I need to know how to do this.....
If i have a tabell in a database with a cell containing a name with 14 letter.

Example: kalle andersson

If i want this name to be shoen as this instead: kalle anders...

How is this posible with script.
I know i must count the letters in the questin but how ??

Reply With Quote
  #2 (permalink)  
Old October 13th, 2003, 06:53 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: High Wycombe, UK, United Kingdom.
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can use the LEFT and RIGHT commands at the ASP level to get this effect, also the SUBSTRING command in Javascript on the client side will do the same thing.
Reply With Quote
  #3 (permalink)  
Old October 13th, 2003, 11:53 PM
Authorized User
 
Join Date: Sep 2003
Location: Trivandrum, Kerala, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to balakumar1000
Default

You can use the select statement like this:

select case
    when len(firstname) > 5 then substring(firstname,1,3) + '...'
    else firstname
end
from table1

--substring(expr, starting, length)

Balakumar V.

Reply With Quote
  #4 (permalink)  
Old October 14th, 2003, 01:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I once did something like this when I had to truncate breadcrumbs...
Code:
full = recTmp("thename")
name = Trim(Left(full, numberOfcharacters))
If Len(full) > numberOfcharacters Then 
   name = name & "..."
End If
Then you can use 'name' to display.

Hope it helps

Jacob.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Latin letters itHighway Classic ASP Professional 3 July 20th, 2006 12:14 AM
Remove letters from numbers Corey Access 7 December 18th, 2005 09:09 PM
"C++ lottery" with letters and words dovids C++ Programming 8 July 19th, 2005 03:11 AM
Capital Letters no Vowels. endamist BOOK: Beginning Java 2 1 August 12th, 2003 05:59 PM



All times are GMT -4. The time now is 05:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.