Ignoring Whitespace with DataTable.Select

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to do a select on a column where the cell values in the column are
padded with whitespace, is there a simple way to have the select expression
ignore the whitespace?

Thanks in advance,

Nick
 
Is it merely a display problem? If so, once you have converted it to a
string you can use the trim function to remove whitespace.
dataRow["COLUMN_NAME"].ToString().Trim()

If it isn't a display problem please try to be a little more specific.

Hope that helps
 
I think i need to be more specific...

the data in the cells I'm doing the datatable.select() on contains leading
whitespace is there a way to trim this in the expression in the select?

Nick



Art said:
Is it merely a display problem? If so, once you have converted it to a
string you can use the trim function to remove whitespace.
dataRow["COLUMN_NAME"].ToString().Trim()

If it isn't a display problem please try to be a little more specific.

Hope that helps
--
There are only 10 types of people in the world. Those that understand
binary and those who don't.


Nick B said:
I'm trying to do a select on a column where the cell values in the column are
padded with whitespace, is there a simple way to have the select expression
ignore the whitespace?

Thanks in advance,

Nick
 
What I need is a way to only ignore whitespace, using * will match any
number of chars, what I need is a way to for example take a search expression
of 'Ac*' and match ' Action' but not ' Faction'.

Thoughts?

Thanks,

Nick

Nick B said:
I think i need to be more specific...

the data in the cells I'm doing the datatable.select() on contains leading
whitespace is there a way to trim this in the expression in the select?

Nick



Art said:
Is it merely a display problem? If so, once you have converted it to a
string you can use the trim function to remove whitespace.
dataRow["COLUMN_NAME"].ToString().Trim()

If it isn't a display problem please try to be a little more specific.

Hope that helps
--
There are only 10 types of people in the world. Those that understand
binary and those who don't.


Nick B said:
I'm trying to do a select on a column where the cell values in the column are
padded with whitespace, is there a simple way to have the select expression
ignore the whitespace?

Thanks in advance,

Nick
 
Back
Top