ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 12th, 2011, 07:38 AM
xerexie xerexie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 10 xerexie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 48 sec
Reputation Power: 0
How to change remaining characters in a string?

Hi. I have to change the remaining characters to '...' when the string is more the 15. How do i do that?

Example:
str = "This is a sample string"

result:
"This is a sampl..."

Thanks in advance.

Reply With Quote
  #2  
Old June 12th, 2011, 08:24 PM
anziga anziga is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 189 anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level)anziga User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 34 m 43 sec
Reputation Power: 327
Check first if the strTest.Length() is more than 15, then use Mid function, something like...
Code:
Dim strTest As String = "This is a sample string"
strTest = Mid(strTest, 1, 15)
MsgBox(strTest & "...")

Reply With Quote
  #3  
Old June 12th, 2011, 10:55 PM
xerexie xerexie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 10 xerexie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 55 m 48 sec
Reputation Power: 0
That helps. Thank you very much.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > How to change remaining characters in a string?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap