Question about using left

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69939?pagenum=1
05 November 2025, 03:13

Topic


bobby131313
Question about using left
08 June 2011, 13:15


So I'm truncating some RSS titles for display...
RSStitleshort = Left(RSStitle,35)

Works great. But is there a way to make it break at the first space after the value so it doesn't stop in the middle of a word?
Thanks in advance...

 

Replies ...


HuwR
08 June 2011, 14:51


try something like
pos = Instr(34,RSStitle," ")
if pos = 0 then
pos = 35
end if
RSStitleshort = Left(RSStitle,pos)
bobby131313
08 June 2011, 16:34


I had to tweak some other code that I *thought* wouldn't matter but that got me where I needed to be.

Thank You! bigsmile
© 2000-2021 Snitz™ Communications