Skip to main content

strings in javascript

 here in this blog we are going to learn about the strings in the javascript

replit link(fb login)

here are the following examples.

let name ="anwar"

// console.log(name)

// console.log(name.length)

// console.log(typeof name)

// console.log(name[1])


// // template literals in StringList

// let name1= "sabih"

// let name2="anwar"

// let sentence=`my name is ${name1} ${name2}`

// console.log(sentence)


// // escape sequence characters

// name='anw\'ar'

// console.log(name)

// name='anw\nar'

// console.log(name)

// name='anw\tar'

// console.log(name)

// name='anw\rar'

// console.log(name)


// escape sequence character types

// \b Backspace

// \f Form Feed

// \n New Line

// \r Carriage Return

// \t Horizontal Tabulator

// \v Vertical Tabulator


// console.log(name.toUpperCase())

// console.log(name.toLowerCase())

// console.log(name.slice(2))

// console.log(name.slice(2,4))

// console.log(name.replace("an","jan"))

// let wife="ghufrana"

// console.log(name.concat(" is a husband of ",wife," ok"))

// let saali="           rizwana          "

// console.log(saali.trim())


// function for loop in string

// i=0

// while(i<name.length){

//   console.log(name[i])

//   i++

// }


Comments

Popular posts from this blog

How to add the treeview numbers to get the grand total in tkinter entry box

 in this blog we are going to know about the adding of the integers in the treeview and get the total in the entry box of tkinter so here is the image first so the coding to do such things are here as follow but here is the condition that pls make assured that the state of entry box is disabled.......      for child in my_tree1 . get_children ():         e2l . config ( state = "normal" )         b1 += float ( my_tree1 . item ( child , "values" )[ 3 ])         var2 . set ( b1 )         e2l . config ( state = "disable" )      l2l = Label ( ento , text = "Purnea-2" , width = 8 )      l2l . grid ( row = 0 , column = 1 )     e2l = Entry ( ento , textvariable = var2 , state = "disable" , width = 8 )     e2l . grid ( row = 1 , column = 1 )