What do you want to save?
Add Code snippet
New code examples
-
-
Python 2022-03-27 01:50:04
how to reverse word order in python
## initializing the string string = "I am a python programmer" ## splitting the string on space words = string.split() ## reversing the words using reversed() function words = list(reversed(words)) ## joining the words and printing print(" ... Add solution -
Javascript 2022-03-24 20:40:11
javascript format date yyyy-mm-dd hh:mm:ss to dd-mm-yyyy hh:mm am/pm
dateString = '2020-04-03 20:30:55'; function formatDate(dateString) { var allDate = dateString.split(' '); var thisDate = allDate[0].split('-'); var thisTime = allDate[1].split(':'); var newDate = [thisDate[2],thisDat... Add solution -
Javascript 2022-03-22 01:05:32
reverse the string in javascript
"this is a test string".split("").reverse().join(""); //"gnirts tset a si siht" //as a function function reverseString(string){ return string.split("").reverse().join("");} reverseString("te... Add solution -
-
Java 2022-02-13 10:05:11
split by new line java
String lines[] = string.split("\\r?\\n"); Add solution -
Other 2022-02-07 09:45:20
godot string split
var some_string = "One,Two,Three,Four" var some_array = some_string.split(",", true, 1) print(some_array.size()) # Prints 2 print(some_array[0]) # Prints "One" print(some_array[1]) # Prints "Two,Three,Four" Add solution -
Python 2022-02-06 14:00:27
python string in set
a_string = 'Hello World Hello' # In case we want to get a 'set' of chars print(set(a_string)) # Output -> {'W', 'r', 'l', 'H', 'd', ' ', 'o', 'e'} # In case we want to get a 'set' of words print(set(a_string.split())) # Output -> {'Hello', 'World'} Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5