473,395 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Ignoring Whitespace with DataTable.Select

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
Nov 8 '06 #1
3 4272
Art
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" wrote:
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
Nov 8 '06 #2
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" wrote:
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" wrote:
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
Nov 9 '06 #3


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" wrote:
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" wrote:
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" wrote:
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
Nov 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tjerk Wolterink | last post by:
Hello all, how does xsl handle white space? I know you can set domething like this for nice indentation: <xsl:output method="xhtml" indent="yes"/> But know i have xsl code like this:
5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
5
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the...
1
by: Neilen Marais | last post by:
Hi I'm trying to compare some text to find differences other than whitespace. I seem to be misunderstanding something, since I can't even get a basic example to work: In : d =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.