Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
stringkeyvalues
//Title of this code //'main' method must be in a class 'Rextester'. import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { String variables = "abcd=32434, xxxx=23423, yyy=234234, zzz=23423"; String[] details = variables.split(","); for (int x=0;x<details.length;x++) { System.out.println("The x value is: "+x); String[] d = details[x].split("="); //System.out.println("The d output is: "+d[x]); //System.out.println("The d length is: "+d.length); if(d.length == 2) { String key = d[0]; String val = d[1]; if(key.equals("yyy")) { System.out.println("Value found:"+val); } } } } }
run
|
edit
|
history
|
help
0
jb15.0
patterns
jb12.0 threads.enums
Roberto02
Instance fields are no overridden
LRU cache - Simple solution (costly)
binary square root
hondaa11
Java Procedural Progamming
Smallest Multiple of N with Zeros and Ones