We have constructed devices in which the interior of a single-walled carbon nanotube (SWCNT) field-effect transistor acts as a nanofluidic channel that connects two fluid reservoirs, permitting measurement of the electronic properties of the SWCNT as it is wetted by an analyte. Wetting of the inside of the SWCNT by water turns the transistor on, while wetting of the outside has little effect. These observations are consistent with theoretical simulations that show that internal water both generates a large dipole electric field, causing charge polarization of the tube and metal electrodes, and shifts the valence band of the SWCNT, while external water has little effect. This finding may provide a new method to investigate water behavior at nanoscale. This also opens a new avenue for building sensors in which the SWCNT simultaneously functions as a concentrator, nanopore, and extremely sensitive electronic detector, exploiting the enhanced sensitivity of the interior surface.