angularjs - How to display the second word first with dot -
i have issue display name in web site.
we clientusername(first , last name) in single string.
now want display first , last name first char dot.
if clientusername srirama reddy need display sriram r.
also, accept first name 12 characters
how can in angular
my controller code
this.loadcurrentclientuserdetails = function () { var clientuserdetails = common.getcurrentclient(); self.clientusername = clientuserdetails.username; self.clientname = clientuserdetails.clientname; };
you can use this
var data=self.clientusername.split(' '); var finalname=data[0].substring(0,12)+" "+data[1].substring(0,1)+"."
this provide required data(also, accept first name 12 characters).
Comments
Post a Comment