1

I need my caml query to return only text, e.g. now it's returning me this

<div class=ExternalClass104BBsdfEEDCEdddsf48C68C18AsdfB056FBsdfAB805>Real Content.....</div>

When I want Real Content..... only. Code I am using is can be found here

http://snahta.blogspot.co.uk/2011/05/discussion-board-multiple-item-threaded.html

Problem is in above example they are getting list items into a data table so i can't use this statement,

item.Fields["Body"].GetFieldValueAsText(item["Body"]).ToString().Trim();

any help will be appreciated

3
  • What is the type of your column?
    – banana
    Aug 19, 2013 at 9:52
  • it's type is banana, it's body column of discussion list Aug 19, 2013 at 9:54
  • What is the type???
    – banana
    Aug 19, 2013 at 11:13

1 Answer 1

3

CAML isn't going to strip out that div as it's part of the column data. You are going to need to use a regex to strip that out after the data has been retrieved.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.