The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Micro Focus/Compuware QALoad

Pages: 1
ppat7046
Active Member


Reged: 02/01/01
Posts: 785
Loc: USA
Find string within string
      #716857 - 09/22/12 10:22 PM

Friends,

I like to share following code which validates https or http protocol exists within URL.

Code:

const char *pSearchInString = "http://Prashant.Patel.com:60307/";
CLoadString sStringToSearch = pSearchInString;
CLoadString s1 = sStringToSearch.Mid(0, 5);
CLoadString s2 = sStringToSearch.Mid(0, 4);
CLoadString Protocol;
if (s1 = "https")
{
Protocol="https";
}
else if (s2 = "http")
{
Protocol="http";
}
else
{
RR__printf( "The value of the Protocol is null" );
}
RR__printf( "The value of the Protocol is: %s", Protocol );



--------------------
Thanks,
Prashant Patel


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 2 anonymous users are browsing this forum.

Moderator:  AJ, DSquared 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 1225

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5