But -in order to make your website yours, you- will need to replace them
I need in result But in (0) index and in order to make your website yours, you- will need to replace them in (1) index.
Please help me out.
But -in order to make your website yours, you- will need to replace them
I need in result But in (0) index and in order to make your website yours, you- will need to replace them in (1) index.
Please help me out.
This will help you to get the array you want, assign below value to an array variable
{strYourString.Substring(0, strYourString.IndexOf("-")), strYourString.Substring(strYourString.IndexOf("-") + 1)}
Hi,
Another solution:
m= System.Text.RegularExpressions.Regex.Match(yourString,"(^[^-]*)-(.*)")
then
m.Groups(1).Value
m.Groups(2).Value
note: m is System.Text.RegularExpressions.Match class.
Sequence2.xaml (5.8 KB)
Regards,
I need to split “but” in one index and rest of the string in one index “-” is repeat t
Multiple time here
input=“But -in order to make your website yours, you- will need to replace them”
expected result is =“in order to make your website yours, you- will need to replace them”
Did you try the above code? that gives you the array you requested. First element as But and rest of the string in second element
regarding this;
you can get this by
strTemp.Substring(strTemp.IndexOf(“-”) + 1)
Always appreciated if you give a close look to the solution provided.
Even @Yoichi has given the absolutely correct solution to your original question with a different approach.
Hi
Let’s go step by step
If the below string input is saved in a string variable named Strinput
We can split the sentence with first occurrence of - like this
int_firstindex = Strinput.IndexOf(“-“)
Where int_firstindex is a variable of type int32
Using ASSIGN activity
str_firstpart = Strinput.SubString(0, int_firstindex)
This Substring expression will try to read from 0 index that is from first character and till first - and split that
For second part
str_secondpart = Strinput.SubString(int_firstindex + 1)
On the second part, the +1
is to avoid including the hyphen.
For more details and ideas on this method
Refer this link
Cheers @Aleem_Khan