Microsoft
Software
Hardware
Network
Question : Removing numbers after underscore
I am currently using the following to take off the last 3 characters of a string:
<%=left(RSorder.Fields.Ite
m("orderSp
ec").Value
, len(RSorder.Fields.Item("o
rderSpec")
.Value)-3)
%>
This turns this Oven Filler Long Grain345 into this Oven Filler Long Grain.
It has now come to my attention that their maybe more than 3 numbers at the end of a string so this isn't the ideal solution.
I would like it so that I could have the string originally appear as Oven Filler Long Grain_345 and no matter how many numbers follow it, everything after the underscore is removed.
I also need to be able to access the number after the underscore as a separate variable.
Is this possible?
Thanks,
Chris
Answer : Removing numbers after underscore
s = "Oven Filler Long Grain_345"
s1 = Left(s, InStrRev("_" & s, "_") -1)
s2 = Mid(s, Len(s1) +1)
Random Solutions
How to get an USB speaker to work with Eee PC 900 Xandros Linux
Need to Recover NT4 Domain Admin Password
how to truncate the transaction logs in exchange 2010 after NT backup
qmail ,mutt problem: Error sending message, child exited 127 (Exec error.).
not seeing auto-recover version of a force-closed excel (2007) document
red ant
How do I configure exchange 2007 to allow iPhone/iPad to work.
vb.net Insert comma every 3 characters
InDesign/MAC PrintBooklet to a PDF file on a mac
Mice seem to stop working frequently, tried multiple mice and USB ports