How to get the first character from string?

Hello,
I have an email which is like this john.doe@gmail.com and what I want is to get the first letter (J) from the name and two first letters (Do) from surname, how can I do it ?

I know that I have to use Substring but don’t know how to achieve this result (JDO)

Hi,

How about the following expression?

New String({yourString(0),yourString(yourString.IndexOf(".")+1),yourString(yourString.IndexOf(".")+2)}).ToUpper()

OR

(yourString(0)+yourString.Substring(yourString.IndexOf(".")+1,2)).ToUpper()

Regards,

It works, thank you wherry much :slight_smile:

1 Like

Regex alternate handling middlenames:
grafik
grafik

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.