Cancel
Showing results for 
Search instead for 
Did you mean: 

Manipulating string

Legend
Legend

Hello All

 

Problem Description:

I have 3 different value from other method(StrgSection_1= "singlerpoc_1",StrgSection_2="assembly";StrgSection_3=somethong else or "").But sometime StrgSection my be empty.

 

i have same steps for all StrgSetion_1,2,and 3). Can you suggest any code of loop?. so i can get value of the StrgSection_1/2/3 and assign it to  StrgSection.

thanks in advance

 

Please check following method :blcked_method.PNG

6 REPLIES 6
Highlighted

Re: Manipulating string

Phenom
Phenom

If you are using a/the same delimiter ( eg "," or ";" etc)

 

have a look at  the splitString function.

Re: Manipulating string

Legend
Legend

Hi @simulator

thanks for quick reply

 

i don't understand your idea.

Actually, i got different string value from past method

(StrgSection_1= "singlerpoc_1" or somethong else

StrgSection_2="assembly" or somethong else

StrgSection_3=somethong else or "").

 

now i want to develop loop, so everytime i don't need to write all step code.

 

for var J:= 1 to 3  --(for all strgsection)

StrgSection:=to_str("StrgSection_",j) --but here i want to assign value of StrgSection_1(here "singlerpoc_1")

next

 

so result is,, StrgSection=singlerpoc_1

 

thanks in advance

Re: Manipulating string

Phenom
Phenom

Either you add (with separator) the stringSections e.g.

 

StrgSection:=to_str(StrgSection_1)+";"+to_str(StrgSection_2)+";"+to_str(StrgSection_3)

 

or you change your 3 stringSection call parameters in the method to an array eg. stringsection : object[3]

 

and then loop through the array

 

 

Re: Manipulating string

Legend
Legend

Hi @simulator

thanks for better idea..i want to apply second.

when i wrote Param StrgSection: String[3].. then, Do i have to change in the previous method which give the value of all strgsection.

 

 

By the way thanks at all

 

my previous method like that:

previous_method.PNG

Re: Manipulating string

Phenom
Phenom

yes , you have to adapt the parameters in the calling method to an array as well :

 

Here's an example:

 

 

Unbenannt.PNG

Re: Manipulating string

Legend
Legend

thank you so much @simulator