Get Proper/Specific Text from a String

1. To get Position of 1st occurence of the string within the string

mvar=Instr(“VB Script is fun!”,”is”)

msgbox(mvar)’returns 1st occurence position of the string/letter within another string

2.To get specific length of the string

MyVar = Mid(“VB Script is fun!”, mvar, 2)
msgbox(MyVar)  ‘ Returns ” is”

3.Suppose if you want to get specific text from a string,when you know the required string within another string but you dont know where it is in.

In this case you can use the following method to get directly:

mvar=Mid(“VB Script is fun!”,Instr(“VB Script is fun!”,”is”),2)
msgbox(mvar)  ‘ Returns  “is”

Example: Try this “I want to be a good quality engineer” find the specific text “quality”,whether it is presented in the given string or not? and get the same

Thanks,

Chinnu

Advertisement
Post a comment or leave a trackback: Trackback URL.

Comments

  • ALI  On July 29, 2010 at 6:51 pm

    i am satisfying with this answer…. can u tell me how and when will we perform regression testing?

    • chinnu9999  On January 22, 2012 at 3:16 pm

      Hi Ali,
      Sorry for the late reply,
      Regression means retesting the unchanged parts of the application. Test cases are re-executed in order to check whether previous functionality of application is working fine and new changes have not introduced any new bugs.
      This is the method of verification, Verifying that the bugs are fixed and the newly added feature have not created in problem in previous working version of software.
      Regression testing is initiated when programmer fix any bug or add new code for new functionality to the system. It is a quality measure to check that new code complies with old code and unmodified code is not getting affected.
      Most of the time testing team has task to check the last minute changes in the system. In such situation testing only affected application area in necessary to complete the testing process in time with covering all major system aspects

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.