Karan28
(Karan Arora)
September 1, 2020, 5:57am
1
Hi All,
I want to check if my strings contains a “+” sign and two characters/alphabets or not.
string can be like this :- ‘26 | 32’!F8+‘26 | 32’!F12
Here the condition satisfies like it contains a “+” sign and two F’s . Like this I have to check others strings too. How should I achieve this?
Please help
1 Like
Hello @Karan28 ,
Use if condition like this, StrVar.Contains(“+”) and StrVar.Contains(“F”)
Cheers
@Karan28
Karan28
(Karan Arora)
September 1, 2020, 6:26am
3
Pradeep_Shiv:
StrVar.Contains(“F”)
StrVar.Contains(“F”) - This cant be because it should be dynamic and any characters can come so I have to check two characters/alphabets present or not . It can be between A-Z
1 Like
Okay so you want to check aplhabets in the string right??
You can use IsMatches Activity and Pass the Pattern Like this [A-Za-z]+ this will return boolean value if your string contains any Alphabets it’ll throw you True message
as you can see, i’ve used sample expression to identify only alphabets!
Give a try and let me know!
Cheers
@Karan28
2 Likes
dfilipovic
(Dino Filipović)
September 1, 2020, 6:56am
5
@Karan28 , you should mark this as a solution.
I have checked it out and it works.
Cheers,
Dino
1 Like
Karan28
(Karan Arora)
September 1, 2020, 8:58am
6
Hey , I want to check if it contains more than one alphabet of not. Not just alphabet
1 Like
Karan28
(Karan Arora)
September 3, 2020, 11:31am
8
Hi Yes I got your solution , But I have to get true only if it have two or more than two alphabets.
It should return false in one alphabet
1 Like
Pradeep_Shiv:
[A-Za-z]+
so if string contains more than two Alphabets it should return false?
Karan28
(Karan Arora)
September 3, 2020, 11:40am
10
It should return false with one Alphabet.
it should return true with two or more than two alphabets
1 Like
Sure, Do this
then use if condition like Cint(outMatches.Count)>=2
Cheers
@Karan28
Karan28
(Karan Arora)
September 3, 2020, 11:53am
12
Pradeep_Shiv:
[A-Za-z]+
Thats an amazing solution , much thanks.
Can I count how many + or - signs contains in string . For example in the above string it contains one + sign. Can I count this too
1 Like
yes, just pass this as pattern “\+” and use same method as i mentioned above
Cheers
@Karan28
Karan28
(Karan Arora)
September 4, 2020, 5:55am
14
Thats amazing , I will mark it a solution . Like I have to check how many + or - it should contains.
As you mentioned it for + sign only
jhgj+jgkhk-gjhg+
Like here the count should be 3. In this way I have to find out
1 Like
Karan28:
jhgj+jgkhk-gjhg+
oh you need both right??
then you can try this (\+|\-)
this will return as 3 count for this string jhgj+jgkhk-gjhg+
Cheers
@Karan28
1 Like
Karan28
(Karan Arora)
September 4, 2020, 8:56am
16
Pradeep_Shiv:
Cheers
Yes I want both thankyou so much
system
(system)
Closed
September 7, 2020, 4:19pm
19
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.