Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
string function to get a letter from a string
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
suppose i have :

dim var = "abcdefgh"
i want to get the letter "c" from var using string function.

supopse i am getting a string at runtime dont know where that letter "c" is .
then how do i get that letter "c" from the string

cheers,
AJ
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Code:
Dim SearchWithinThis As String = "ABCDEFGHIJKLMNOP"
Dim SearchForThis As String = "DEF"
Dim FirstCharacter As Integer = SearchWithinThis.IndexOf(SearchForThis)

Have you tried that yet? It's straight from the MSDN library.
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
i wan tit in qtp vbscript
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Try Instr() function . It returns the position of the first occurrence of one string within another.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help in creating dynamic object string using Childobjects Keshub Mathur 0 1,629 09-11-2017, 05:52 PM
Last Post: Keshub Mathur
  How to extract particular digit from a string amit25007 3 3,504 10-05-2016, 10:49 AM
Last Post: Ankur
  Not able to use wild character in string amit25007 2 2,657 03-09-2016, 10:36 AM
Last Post: amit25007
  String Pattern : Alternet Character Capital abhideshpande001 4 3,666 09-03-2015, 03:43 PM
Last Post: abhideshpande001
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 3,033 11-27-2014, 12:53 PM
Last Post: jitenderkkr

Forum Jump:


Users browsing this thread: 1 Guest(s)