Code example for StringTokenizer

Methods: countTokensnextToken

0
	} 
 
	private ItemLoc addItemLoc(String text)
	{ 
		ItemLoc item = null;
		StringTokenizer st = new StringTokenizer(text, ",");
		 
		if(st.countTokens() == 2)
		{ 
			item = new ItemLoc();
			item.setItem(st.nextToken());
			item.setAisle(st.nextToken());
			item.setQuantity("1");
		} 
		 
		return item;
	} 
} 
Experience pair programming with AI  Get Codota for Java