Monday, May 5, 2008

Day 6 - Question : Breaking Strings

You are given a string containing a string Date of Birth in DD/MM/YYYY format. Eg "15/08/1947". Write a function that takes the string as an input and returns a vector containing 3 elements:
v[0] = Day as an integer
v[1] = Month as an integer
v[2] = Year as an integer

eg:
INPUT : "15/08/1947"
Output: [15, 8, 1947]

No comments: