I’m working with an entity (Employee) that has 3 fields: FirstName, LastName, & Login
I want to grab the lastname and the first letter of the firstname field and write this to the login field. How do I grab the first letter of the firstname?
Thanks for any help.
To get the first character (not necessarily a letter) use an index into the string:
You may also want to first check that the string is non-null and non-empty and strip leading whitespace, and that the first character is actually a letter: