Hello,
I have a datatable where 1 column has a string ( called Description ) with a text. I need to save the row where the column has a kinf of material, example, notebook. I used acitivy IF where is the conditional was TRUE, I´ll save. The condition wrote : Description.Contains(“notebook”).
My problem is, notebook can be write like : notebook, NOTEBOOK, Notebook, NoteBook, etc… There is a option that I can see th word without considerate sensetive key?
Hi
you can use
Description.toupper.Contains(“NOTEBOOK”)
Convert string to upper and check if its equal to NOTEBOOK
There wasn´t something to verify if the word exists just with 1 only command? Using your consideration, I´ll need to do 3 or more searchs: notebook, NOTEBOOK, Notebook, etc
You have to check if it contains the word (notebook) or it have to be in the same format as well because we convert it into upper case
notebook - NOTEBOOK
Notebook - NOTEBOOK
NOTEBOOK - NOTEBOOK
I need to check the word.
Then the above method will work…try and let me know if anything needs thanks
Hi @Rodrigo_Fraga ,
Try to convert both the value which you want to compare to lowercase or uppercase and use .Contain function as mentioned below:
“This Notebook is Empty”.Tolower.Contains(“noteBook”.ToLower)
The above expression with return true as it has the keyword “notebook”
you should change your condition to something like this Description.ToLower.Contains(“notebook”) …
Hope this helps! Happy Coding!!! Please mark this as solution if it works for you
You can use:
Description.IndexOf("your_word", StringComparison.OrdinalIgnoreCase) > -1
This will match your word in a case-insensitive way.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.