Dear UiPathers
Is it possible to check if something DOES NOT start with something else?
An example could be, I want to test if a string DOES NOT start with the letter “x”?
Is there an efficient way to do that?
Dear UiPathers
Is it possible to check if something DOES NOT start with something else?
An example could be, I want to test if a string DOES NOT start with the letter “x”?
Is there an efficient way to do that?
Try with this,
Not (yourStringVariable.StartsWith("yourStringToCheck", StringComparison.OrdinalIgnoreCase))
HI @nmjvk
You can try with Regex Expression
System.Text.RegularExpressions.Regex.IsMatch(YourInputString,"^x|^X")
Regards
Gokul
Yes,
Try
Not string_name.startswith("x")
Not YourStringVar.Trim().StartsWith("x")
Or (harmonized)
Not YourStringVar.Trim().ToUpperStartsWith("X")
HI @nmjvk
Try with this expression
System.Text.RegularExpressions.Regex.IsMatch(YourInputString,"^P-enhedens")
Regards
Gokul
You have duplicate variable in the panel delete any one of them and check it @nmjvk
For each Activity: item in dt.Columns.Cast(Of DataColumn).Select(Function (x) x.ColumnName)
TypeArgument: String
If Activity: Not item.Trim().StartsWith(“P-enhedens”) - when it should be negated, otherwise ommit the Not
Then: Remove DataColumn use Colname: item
Else: do other things
Kindly note: we are looping over the names because of would we loop over the columns and delete a column we would get a collection modified exception
As an alternate we can alos loop over dt.Clone.Columns then we can delete columns from original datatable without collection modified exception
I come from a programming background, I know most langauges support negation such as “Not(something)” which works perfect, it’s simple and easy to read. Does UiPath offer the same?
This we can never know when we do read a question.Perfect with all given samples you can finalize and close the topic
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum
Your variable is not initialized properly. Can you check the variable Ft2 and Counter?
That’s it, I did not properly declare my variable. Solutions given by @sarathi125 and @ronconi works the best for me. I will accept @sarathi125 answer since he was the first. Thanks!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.