Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8679703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:02:30+00:00 2026-06-12T21:02:30+00:00

I’m having trouble getting line breaks to occur on a specific character on my

  • 0

I’m having trouble getting line breaks to occur on a specific character on my asp.net site. I have a gridview with user accounts that has an ‘Entitlements’ column/field, in which data is entered with pipes, such as the following:

‘Admin|Trader|Support|Sales’

I know this is not the best data architecture, but it has to stay like this for the time being until we add an entitlements table in the database.

Now, what I want to display in the actual gridview is this:

Admin
Trader
Support
Sales

In other words I want to replace each pipe with a line break, or at least add a line break at each pipe, so that each entitlement is on a separate line.

Is there a way to do this in my CSS class? I looked through different attributes such as white-space, text-overflow, and word-wrap, but so far I haven’t found anything that will say “wrap text on any occurence of this character”. I suppose I can use jQuery to do this, but it seems like there should be a simpler solution.

If jQuery is the way to go, then an example would be appreciated, as I’m new to jQuery.

Thanks for any help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T21:02:31+00:00Added an answer on June 12, 2026 at 9:02 pm

    You can do it any number of ways.

    In the database:

    SELECT REPLACE(entitlements, '|', '<br/>')
    

    In jQuery:

    $('.entitlements').each(function(){
        var $obj = $(this);
        var txt = $obj.text();
        $obj.html(txt.replace(/|/g, '<br/>'))
    });
    

    In asp.net:

    <%# FormatEntitlements(Eval("Entitlements"))%>
    
    public static string FormatEntitlements(string entitlements)
    {
        return (entitlements ?? "").Replace("|", "<br/>");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.