Filter row by the character is starts with

activities

#1

I would like to filter rows by the start character to be ‘A’.
e.g.
Apple
Banana
Accrison

I would only want the apple and accrison as the output… How may I go about doing so?

Thank you xoxo


#2

@sangasangasanga Use below statement. You will get result as dataTable based on ur variable.

UrDataTableVariable.Select("[UrcolumnName] Like’A%’").CopyToDataTable


#3

@Manjuts90
Hi is there any other way. I would like filter first then add to dt


#4

@sangasangasanga In for each row of datatable, Get value from required column, using if condition check first letter has required alphabet, If condition is true add row to new datatable otherwise loop go to next and process repeat.


#5

@Manjuts90
Seems workable. But i need your help, this code doesn’t work for the if condition
row.Select(“Like ‘G’%”)


#6

@sangasangasanga In if condition dont use below condition

row.Select(“Like ‘G’%”)


#7

@Manjuts90 hmm what condition can i use?


#8

@sangasangasanga

Below condition is simple than other method Bro

UrDataTableVariable.Select("[UrcolumnName] Like’A%’").CopyToDataTable


#9

Hi,
There are another option available, you can use a IF condition and put there
yourstring.tostring.startwith(“A”)

Thanks & Regards
Bagish Ojha