Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
6628 มุมมอง

I want to replace the dot (.) with comma (,) and the comma with colon, that's it, a swap of the characters.


Is there any swap function in QWeb?

อวตาร
ละทิ้ง
ผู้เขียน

I meant to say:

I want to replace the dot (.) with comma (,) and the comma with dot, that's it, a swap of the characters.

I don't know why I cannot edit my own post...

คำตอบที่ดีที่สุด

use python string.replace in t-raw, watch for the order.

....

<t t-raw="'this string includes . , . , . '.replace(',',':').replace('.' , ',')" />

...

อวตาร
ละทิ้ง
ผู้เขียน

Thanks, but that's exactly what am I doing, with an extra intermediate replace. I want to know if there is a swap function to avoid the 3 calls to replace function.

nope. unless you add it yourself.

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ต.ค. 23
3005
2
ก.ค. 23
6311
1
มิ.ย. 23
4328
1
เม.ย. 23
5046
1
พ.ย. 22
3759