Convert String

How i can covert name= Sandhya Gajare to Name=Gajare, Sandhya

@Gokul_Jayakumar why you delete post

Hi @Sandhya_Gajare,

You can use this assign.

Split(name," ").Last + “, " + Split(name,” ").First

Regards
Ömer

@Sandhya_Gajare
Try this

=YourString.Split(" ")(1).tostring+", "+YourString.Split(" ")(0).tostring

@Sandhya_Gajare you can split the string and then concatenate the split strings in your required format using string.format

and what should i use
if my Fname=Sandhya
Lname=Gajare
and now my string =Sandhya Gajare
now that string conver to Gajare, Sandhya

HI @Sandhya_Gajare

You can try with

"Sandhya Gajare".Split(" "c)(1)+" "+"Sandhya Gajare".Split(" "c)(0)

image

Just use Lname+" "+ Fname

Regards
Gokul

@Sandhya_Gajare

FirstName=YourString.Split(" ")(0).tostring
LastName=YourString.Split(" ")(1).tostring

Name=LastName+", "+FirstName

In my code my queue data is strName=Sandhya Gajare
My excel data in column :Name=Gajare,Sandhya
To check and compaire data with queue i am using

strName.Contains(CurrentRow(“Name”).ToString) but my excel data is in Gajare,Sandhya Formate i have to match both data that queue data and excel data how i can do

HI @Sandhya_Gajare

Try with this expression

strName.Split(" "c)(1)+","+strName.Split(" "c)(0).Contains(CurrentRow(“Name”).ToString)

Regards
Gokul

1 Like

isn’t it the same as another topic? I already provided you workflow :sweat_smile:

Anyhow, here is what I have done on another topic for you.

  • Sort the excel name
  • Sort the Queue Name

array[string] queueFullNameSorted = queueFullName.Split(" “c).OrderBy(Function(x) x).ToArray()
array[string] excelFullNameSorted = excelFullName.Split(” "c).OrderBy(Function(x) x).ToArray()

  • join the sorted array variables

queueFullName= String.Join(" “,queueFullNameSorted ).ToUpper
excelFullName = String.Join(” ",fullNameSorted).ToUpper

  • use if the condition

if(excelFullName.Contains(queueFullName))

this way your name will always be in the same order when you compare in the if statement.

HI @Sandhya_Gajare

Checkout this expression

String.Join(", ","Sandhya Gajare".Split(" ").ToArray().Reverse)

image

Hope this helps!!

Regards
Sudharsan

1 Like

Thank you so much

1 Like

if i use this in if loop is it work for me

Yes @Sandhya_Gajare , You need to use this in the if activity


showing error

@Sandhya_Gajare
Try this

(strName.Split(" "c)(1)+","+strName.Split(" "c)(0)).Contains(CurrentRow(“Name”).ToString)

Hi @Sandhya_Gajare

Assign activity

ReverseStr = strName.ToString.Split(" "c)(1)+","+strName.ToString.Split(" "c)(0)

If activity

ReverseStr.Contains(ExcelName)

Check out the screenshot

image

2 Likes

Can you tell what is the condition you are going to give? @Sandhya_Gajare

Can you try this in your condition @Sandhya_Gajare

String.Join(", ","Sandhya Gajare".Split(" ").ToArray().Reverse).Contains(CurrentRow("Name").ToString)

Regards
Sudharsan

1 Like