Checking to see if a part of a string exist in a certain string

Suppose I have a string: PPP code.servername.iga.app.bbrc-object
and it is stored in a variable
$RC_LABEL

how do I CHECK TO SEE USING AN IF STMT
TO DETERMINE IF iga.app.bbrc-object IS PRESENT IN THE
WHOLE STRING( PPP code.servername.iga.app.bbrc-object)

THANKS.
CODERAsked:
Who is Participating?
 
geotigerConnect With a Mentor Commented:
use the following statement:

if ($RC_LABEL =~ /iga.app.bbrc-object/)  
0
 
clockwatcherCommented:
You may want to escape those periods.

if ($RC_LABEL =~ /iga\.app\.bbrc-object/)

0
 
shlomoyCommented:
if ($RC_LABEL eq "iga.app.bbrc-object")


if you want to check if your string is equal to "iga.app.bbrc-object"
0
 
CODERAuthor Commented:
THANKS AGAIN!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.