# How to retrieve value between 2 characters?

var str="Cart saved as Quote No :14393430\*";

var mySubString = str.substring(str.lastIndexOf(":") + 1,str.lastIndexOf("\*"));

You can use the below code to retrieve the value between ":" and "\*"

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/BDBNyihWyQShWUbL-60fac5df3bd2.png)<div id="bkmrk-last-updated%3A-june-2">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">June 26, 2023</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>