<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 14/11/2012 09:26, Lucky Khoza wrote:<br>
</div>
<blockquote
cite="mid:CAFLv=vbMVwrJv1HfR8dbLa39Pj98X6nvvAVYhPbv1KCP=OFncA@mail.gmail.com"
type="cite">Hi Erlang Developers,<br>
<br>
How do i convert date string: "2012/02/15" to 2012/2/15, just to
get rid of trailing Zero.<br>
<br>
</blockquote>
Lucky, this is at least the third trivial problem you asked in
recent days. <br>
<br>
Programming is the challenge of discovering how to solve a
continuous series of new problems. If you don't think you would like
to do that, find something else to do. If you do, go to it. <br>
<br>
How I would approach it: <br>
<br>
1) Define the problem ACCURATELY - its leading zeroes you want to
remove. <br>
<br>
2) Find three ways to solve the problem. <br>
e.g.<br>
a) Split it up in to its parts, chop off leading zeros,
reassemble. <br>
b) Its a date, so convert to binary date and convert back to
formatted date using library functions. <br>
c) Parse it to remove any zero that occurs after a slash. <br>
<br>
3) Choose the best, implement it and test it properly. <br>
<br>
Regards<br>
<br>
Ian<br>
<br>
<blockquote
cite="mid:CAFLv=vbMVwrJv1HfR8dbLa39Pj98X6nvvAVYhPbv1KCP=OFncA@mail.gmail.com"
type="cite"><br>
Kindest Regards<br>
Lucky<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
</body>
</html>