Answers for "add var into string"

16

how to create string in python

string = "this is string"
#or
string = 'this is also string'
Posted by: Guest on April-15-2020
-2

add a slash to string in javascript

var str = 'USDYEN'
// add a / in between currencies
// var newStr = str.slice(0, 3) + ' / ' + str.slice(3)

// var newStr = str.slice(3) // removes the first 3 chars
// var newStr = str.slice(0,3) // removes the last 3 chars
var newStr = str.slice(0,3) + ' / ' + str.slice(3) // removes the first 3 and adds the last 3

console.log(newStr)
// => USD / YEN
Posted by: Guest on February-12-2020

Python Answers by Framework

Browse Popular Code Answers by Language