STRING SPLIT OPTION

I am getting the output as "soumi soumiya" “soumiyas14@gmail.com i need to remove this soumiyas14@gmail.com and store only soumisoumiya in a variable. I used Split option Split(name.ToString(),“<”) and stored in the variable named as username. when i display this user name i am getting output as “System.String[]” i should get the output as soumisoumiya can any one say me what wrong i had done else should i go with other string functions… please help me

@soumi_soumiya

Try this one:

Split(name.ToString(),“<”)(0)

Thank you it works…:slightly_smiling_face:
I have an other doubt from this format i need to extract only 18jul2019 how can i achieve it same split string function can be used .
date

@soumi_soumiya

strDate = “Thu, 18 Jul 2019 10:14:01 +0530”

DateTime.parseExact(Split(strDate.Tostring(),“+”)(0),“DDD, dd MMM yyyy HH:mm:ss”,System.Globalization.CultureInfo.InvariantCulture).Tostring(“ddMMMyyyy”).Trim

Thanks for your reply…!!!
Your helping me a looot…
when use this i am getting an error i have attached below
date%20rename

@soumi_soumiya

Is the time is in 24 or 12 Hrs format ?

12 hrs format

@soumi_soumiya

Then replace HH with hh and try.

ok i got it thanks

can you say me how to remove the space between soumi soumiya and also the double qoutes i tried with trim but i cant get it is there any other way

@soumi_soumiya

varName = “soumi soumiya”

Try this: varName.Trim

Note:
TrimStart - To remove spaces at the beginning of the string.

TrimEnd - To remove spaces at the end of the String.

Trim - To remove spaces before, after or in between String.

Thanks for your reply
i gave the same command but i am getting only soumi soumiya

@soumi_soumiya

Show me screenshot of input String and that Trim Expression.

Thanks for your reply… and sorry for delay here is the attachment you check it. i am getting the same output without any change
trim%20error

Hi @soumi_soumiya
This is very simple, try like this -
name = “soumi soumiya”
output = name.replace(" ", “”)

ThanksMain.xaml (4.4 KB)

kumar

@soumi_soumiya

Could you please show me what you assigned to username variable and print the value of uname using write line or message box activity.

This is used to get the user name and mail id of the sender.
from%20gmail
output is
mail%20id
This is used to remove the mail id
remove%20mailid
output is
name%20error
to remove space and double quotes
trim%20error
but still i get the previous output only
Thanks and Regards
Soumiya S

Thanks for your reply it works

Thanks and Regards
Soumiya

@soumi_soumiya

Try this:

Split(name.Tostring(),“<”)(0).Replace(" " ").Trim

it is giving an error that
Compiler errror(s) encountered processing expression “Split(name.Tostring(),”<“)(0).Replace(” " “).Trim”.
Comma,‘0’, or a valid expression continuation expected.