Remove html formatting from multi selection, people picker and single selection field RRS feed

  • Question

  • Hi,

    I am fetching values from list columns, which is multiselection box, single selection and people picker.

    Able to fetch values, but its displaying with HTML formatting as follows:

    1. I have "Customers" field (Multiselection box), selected only one field in it,output as follows:

    Declaration :  string tempCustomer = newItem["Customers"].ToString(); string[] customer = tempCustomer.Split(';');

    Result: {string[2]}   [0]: "3"    [1]: "#Customer3"

    I just need value : "Customer3"

    2. In people picker(FWCResponsible), can select multiple values, but selected only one

    Declaration : newItem["FWCResponsible"].ToString();

    Result:  "2;#Jayashri Vasant Thorat"

    3. In single selection(Drop down list) (PBU), selecting one value

    Declaration : newItem["PBU"].ToString()

    Result :  "8;#Rambøll Norway"

    Request you to assist on this.

    Thanking you in advance.



    Thursday, March 9, 2017 12:04 PM

All replies

  • Hi Jayashri,

    You need to handle the string by substring method, for example in question 1, we can use substring like below:

    string customer = tempCustomer.Split(';')[1].substring(1,9);

    It will output the value "Customer3".

    For more information about using Substring method, please refer the demo below:


    Best Regards

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Monday, March 13, 2017 2:56 AM