Hi,

i need to replace , with ',' how can i acheive it

SyntaxEditor Code Snippet

Replace(Target,(","),("','"))

where target contains the values( value1,value2,value3)


thanks,

Ronan T.


Ronan T wrote:

Hi,

i need to replace , with ',' how can i acheive it

SyntaxEditor Code Snippet

Replace(Target,(","),("','"))

where target contains the values value1,value2,value3


thanks,

Ronan T.



Can u try this 

SyntaxEditor Code Snippet

Replace("target",",","','")


Aamin wrote:

Ronan T wrote:

Hi,

i need to replace , with ',' how can i acheive it

SyntaxEditor Code Snippet

Replace(Target,(","),("','"))

where target contains the values value1,value2,value3


thanks,

Ronan T.



Can u try this 

SyntaxEditor Code Snippet

Replace("target",",","','")


Hi Aamin,

It   is replacing all the values with word target

here Target=value1,value2,value3


Thanks,

Ronan T.


Hi Ronan,

it will replace all , with ',' this. 

Whats your use case.

Replace(Target, ",", "','")

Should be working.

This will change 

value1,value2,value3

To 

value1','value2','value3

Joey Moree wrote:

Replace(Target, ",", "','")

Should be working.

This will change 

value1,value2,value3

To 

value1','value2','value3

Hi Joey Moree,

no it is not displaying like as expected.

the output is 

value1 value2 value3

Thanks,

Ronan T



Hi Rohan,

Can you share what you are doing. Please make confirm whats target value (input). code snippet is correct and should be working.

Aamin wrote:

Hi Rohan,

Can you share what you are doing. Please make confirm whats target value (input). code snippet is correct and should be working.

Hi Aamin,

SyntaxEditor Code Snippet

Replace("123,35678,468", ",", "','")

the output was 123 35678 468

but the actually o/p what i need is 123','35678','468


Thanks,

Ronan T

Hey Ronan,

You might be doing something else which changes it to a " " instead...

Replace("123,35678,468", ",", "','")

Output: 


Joey Moree wrote:

Hey Ronan,

You might be doing something else which changes it to a " " instead...

Replace("123,35678,468", ",", "','")

Output: 


Hi Joey Moree,

The above code is what i have used.


Thanks,

Ronan T.


Hi Ronan,

What's the version of the platform you are using?

Please, provide a small module where you use this function like you are using in your code, that reproduces your problem, and attach here.

As others already stated, it should work. So, it is very strange if for you it does not.
A module reproducing the problem will help understand where is the problem.

Cheers.

Eduardo Jauch wrote:

Hi Ronan,

What's the version of the platform you are using?

Please, provide a small module where you use this function like you are using in your code, that reproduces your problem, and attach here.

As others already stated, it should work. So, it is very strange if for you it does not.
A module reproducing the problem will help understand where is the problem.

Cheers.

Hi Eduardo Jauch,

I am using outsystems version 10

Thanks,

Ronan T.


Hi Ronan,

Have you even debugged? And checked in the debugger the result of the Replace() directly after it executed, instead of relying what you're seeing on your screen? If not, please do so, instead of keeping three (four including me) community members busy with what should be a no-breainer? Thanks.

I'd like to present a screenshot, running on P10.


You sure you are not encapsulating the string somewhere with escapehtml orso?