Post Closed
2839
Views
15
Comments
replace()
Question

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.


2021-03-30 06-52-52
Ali Amin

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",",","','")


UserImage.jpg
Ronan T

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.


2021-03-30 06-52-52
Ali Amin

Hi Ronan,

it will replace all , with ',' this. 

Whats your use case.

2017-12-13 08-27-28
Joey Moree
Replace(Target, ",", "','")

Should be working.

This will change 

value1,value2,value3

To 

value1','value2','value3

UserImage.jpg
Ronan T

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



2021-03-30 06-52-52
Ali Amin

Hi Rohan,

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

UserImage.jpg
Ronan T

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

2017-12-13 08-27-28
Joey Moree

Hey Ronan,

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

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

Output: 


UserImage.jpg
Ronan T

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.


2020-02-28 09-46-54
Eduardo Jauch

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.

UserImage.jpg
Ronan T

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.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.

2017-12-13 08-27-28
Joey Moree

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


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

2020-09-23 06-45-50
Sathish Ramanujam

HI OutSystems ,

                    Let me know how to DE serialize  the following JSON String . Am not able to DE serialize the JSON String .

"[{""WoEntry"":4190,""WoNum"":4593,""U_DocDate"":""16-09-2020"",""U_ItemCode"":""RSS-PL-25ARUL-W"",""U_ItemName"":""ModelNo:RE-25ARConven 4 Zone Agent Release FACP White with 2 Release Module-UL Listed"",""WOQty"":25.000000}]"



2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Satish,

Your question has absolutely noting to do with the original topic. Please start a new topic.