How to use the trim, split, substring, remove

Hey,
Few examples are here:
How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right

1 Like

Hi All,

I have an issue regarding string like i have an complete name and want to remove the middle name if there is an available the middle name.

example1:- Daniel John Hadduxx (want to remove john in complete name)

eaxmple 2:- Michele Madduxx(no requirement to remove anything because middle name is not available.)

Please, suggest me

Hi Abhi,

Please find the below screenshot of solution. Please mark it as solution if it really help you.

Remove_String2

1 Like

RemoveMiddleName.xaml (5.9 KB)

Thanks!

1 Like

Here are few detailed articles on that :slight_smile:

@abhi_kumar_singh

Here is the solution. Put the string in a variable

example

var= “abc,def,ghi,jkl,mno,pqr,”
FinalVar= str1.TrimEnd(","c) ( use assign activity)

Now the final will contain only “abc,def,ghi,jkl,mno,pqr”

image

Can anyone help me …
I have a string as “apple, mango, banana, peach”
But I want output as [“apple”, “mango”, “banana”, “peach”]
Thanks for advance

@Sunita_Hembram

please see this I think it will help you

Your given string
Fruits=“apple, mango, banana, peach”

Split this string by (,)

Split=split(","c) (Split variable should be in one dimension array)

assign in a variable.
Fruit= “[”+"’"+Split(0).ToString+"’"+","+"’"+Split(1).ToString+"’"+","+"’"+Split(2).ToString+","+"’"+Split(3).ToString+"’"+"]"

and remove the extra content (+) by fruit.remove("+"","")

your result will be
[“apple”, “mango”, “banana”, “peach”]

Find the attached the file as well.Main.xaml (5.0 KB)

Thanks
Farhan

1 Like

if we have more items in strings that time how to convert into array of strings

You could achieve this in 4 assign statements:
1/ You have a text
2/ Convert your text to Array(of string) using split method
3/ Quote each element using lambda expression
4/ Build final output sting using join method

strInput = “apple, mango, banana, peach”
stringArray = strInput.Split({","c})
stringArray = stringArray.Select(function(x) """" + x.Trim + """").ToArray
strOutput = "[" + string.Join(",",strArray) + "]"

Cheers

1 Like

Thanks @J0ska … its working now…

@J0ska … Is it possible to run multiple processes at a same time, if yes then how… Please help me out

Not sure what you mean and how it relates to the topic of this thread.
If not pls open a new thread.

Cheers

this is the simplest and efficient answer. appreciate your support

1 Like

Sure you can do tht with the parallel activity.

Just drag different sequences or flow charts intho the prallel activity and they will be executed at the same time.