Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


To find last 2nd specific char

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,48824
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> To find last 2nd specific char
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 To find last 2nd specific char - 6/27/2007 2:12:26 PM   
  wmec

 

Posts: 125
Score: 0
Joined: 8/5/2004
From: Hong Kong, China
Status: offline
Hi,
For a string like "some char ^AB^CD", is there a function, for finding out the position of the last 2nd "^" inside? Is "last(?? )" supported by VB script?

Actually the string can be like "some char ^^^^^^^^^AB^CD". And for me it's safe to know that of the last 2nd "^".

It's OK for this already using '-1' for 'last parameter' by 'InStrRev'.

< Message edited by wmec -- 6/27/2007 2:43:11 PM >


_____________________________

Thanks & Best Regards,

HuaMin Chen
 
 
Post #: 1
 
 RE: To find last 2nd specific char - 6/27/2007 2:19:58 PM   
  dm_4ever


Posts: 2663
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Well for the last in the example you showed you could try.

Dim str : str = "some char ^AB^CD"
WScript.Echo InStrRev(str, "^")

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to wmec)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> To find last 2nd specific char Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts