How to create half of the string in uppercase and the other half in lowercase ? |
var string1 = ' ' ; var string1_len = string1 . length ; var half_string = Math . ceil ( string1_len / 2 ) ; var part_a ; var part_b ; part_a = string1 . slice ( 0 , half_string ) ; var new_part_a = part_a . toUpperCase ( ) ; part_b = string1 . slice ( half_string , string1_len ) ; var changed_string = new_part_a + part_b ; console . log ( changed_string ) ;