Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
How to strip last 6 characters in a string using jQuery
Old 08-17-2009, 11:23 PM How to strip last 6 characters in a string using jQuery
TWD
TWD's Avatar
King Spam Talker

Posts: 1,112
Trades: 0
There are a series of thumbnails on the page which all
have the following file format.

filename_small.jpg

I can read the file name as a string.

How can I remove the "_small" from the string.

Is it best to use the "slice" function,
"remove" function or
"replace" function?
TWD is online now
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-17-2009, 11:58 PM Re: How to strip last 6 characters in a string using jQuery
TWD
TWD's Avatar
King Spam Talker

Posts: 1,112
Trades: 0
As often happens, I answered my own question.
Code:
newImg.src = Img.replace('_small','');
TWD is online now
Reply With Quote
View Public Profile
 
Reply     « Reply to How to strip last 6 characters in a string using jQuery
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20607 seconds with 12 queries