I have a list of names stored in the variable
Names : "Amit Singh, Kumar Anand"
Names : "Ashish Singh"
The names can be singular or multiple, separated by commas like "James, Anand, xyz,..."
During a for loop iteration
<div *ngFor="let user of Info">
{{ (user.Names != null && user.Names.length>0) ?
(user.Names |
slice:0:1)
: '' }}
</div>
The current output is A
, but I would like to see AS
instead. If there are multiple names with a comma, I want to display M
replacing the first and last name.
Any suggestions? Thank you!