DStream to an array (Spark Streaming)

Hey guys, can someone please help me convert DStream to an array?

Thanks in advance,
Gayithri Krishna

if it is DStream dstream =…;

dstream.map(new Function<String, String>() {

		@Override
		public String call(String input) throws Exception 
              {
			
			String array] = input.split(" ");//split the string by  space
			
		}
            return null ;//any String 
	}).print();