[Solved] Truncate,trim strings in qml
-
wrote on 13 Aug 2014, 07:37 last edited by
Hi
I need to truncate or trim the first few characters of a string in qml.Does qml supports these functions?
if so how do i do it?Ex:
@
property var string = "Thumb_Image"
@The required output is "Image"
Please help me if anyone knows the best solution
Thanks in Advance
Bala Beemaneni -
That code is actually JavaScript, so you can use the JS API for this: "link":http://www.w3schools.com/jsref/jsref_obj_string.asp.
-
wrote on 13 Aug 2014, 10:02 last edited by
Thanks sierdzio
That solved my requirement
@Ex:
r_imageName = fileName.replace("Thumb_","")
r_imageName = r_imageName.replace(".png",".jpg")@Thanks
Bala Beemaneni
1/3