Guru Ji
asked on
Format String in ASP.net C#
I have a string strnames which contains following
Tony, Ray, Arnold, Wood, Ken, Jeff: Scheduled for workshop
What I want is to hide all the names after the 3rd occurrence of comma but then display the rest of the text after the colon
So the text will be like this (three dots showing there are more people, that I want to create a hyperlink to show entire string if someone clicks on the three dots just like facebook comments they have view more button)
Tony, Ray, Arnold ... : Scheduled for workshop
Tony, Ray, Arnold, Wood, Ken, Jeff: Scheduled for workshop
What I want is to hide all the names after the 3rd occurrence of comma but then display the rest of the text after the colon
So the text will be like this (three dots showing there are more people, that I want to create a hyperlink to show entire string if someone clicks on the three dots just like facebook comments they have view more button)
Tony, Ray, Arnold ... : Scheduled for workshop
ASKER
The names var does not return string like
tony, ray, arnold
How do I display only first three comma delimited values with comma in between them.
tony, ray, arnold
How do I display only first three comma delimited values with comma in between them.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi binaryyevo,
I got it working, what I did I created two labels
label1.text = "tony, ray, arnold ... more : scheudle";
label2.text ="tony, ray, arnold, wood, ken, jeff: scheudle";
label2 is hidden by default.
How can I create that "... more" in label1 to a link which will let me hide label1 and show label2 without refreshing page.
My whole point of doing this is to hide usernames if showing more than 3 people
I got it working, what I did I created two labels
label1.text = "tony, ray, arnold ... more : scheudle";
label2.text ="tony, ray, arnold, wood, ken, jeff: scheudle";
label2 is hidden by default.
How can I create that "... more" in label1 to a link which will let me hide label1 and show label2 without refreshing page.
My whole point of doing this is to hide usernames if showing more than 3 people
Open in new window
Hope this helps and if you need more guidance let me know.