Get Views field value in Twig template I'm trying to get the value of a field and use it as a class for a wrapper of another field within a Views display. So essentially what I need is to be able to get a string representation of the first field. The field already is a text field but when I try getting the content it doesn't just give me a string, which is what I need to be able to use is as a class for my second field.

I've tried using {{ fields.[field_name].content }} but that renders the twig template recommendation along with the data. I tried using the getValue() function, but that doesn't return anything. I tried passing the data through the raw twig filter but that doesn't return anything. I tried rendering the array using dpm and kint but they both give me way too much information and I can't narrow it down to what array item or object I need to use. I'm new to Drupal so maybe I'm not using Devel and Kint correctly to find what I'm looking for.

Is there a function I have to use to get the content data as a string or just raw, or is there some other way I can accomplish this?

I am using Drupal 8.1.
field.content is the rendered field. And in views that means it is no longer a render array, but the finally rendered markup. So this is very problematic to use it as a class name, not only because of twig debug. 

Better use the row data, where you find the entity object with the field data from the database. Use clean_class to escape it for using it as a class name:

{{ row._entity.field_myfield.value|clean_class }}