AssocArray to string is ok,but how to get the AssocArray from string? Thanks

Nicholas Wilson iamthewilsonator at hotmail.com
Wed Dec 13 08:39:00 UTC 2017


On Tuesday, 12 December 2017 at 17:32:15 UTC, Frank Like wrote:
> Hi,everyone,
> who can help me,about the "AssocArray to string is ok,but how 
> to get the AssocArray from string? ".
>
> For example:
>
> SysTime[][string] AATimes;
> AATimes["a1"] =[SysTime(DateTime(2017, 1, 1, 12, 33, 
> 33)),SysTime(DateTime(2017, 1, 2, 12, 33, 33))];
> AATimes["a2"] =[SysTime(DateTime(2017, 1, 2, 12, 33, 
> 33)),SysTime(DateTime(2017, 1, 3, 12, 33, 33))];
>
>   ubyte[] ua = cast(ubyte[])AATimes.to!string;
>   writeln("ua is ",ua);
> 	
>   string strTimes = cast(string)ua;
>    writeln("strTimes is ",strTimes);
>
> But now,how to get the AATimes from string?
>
> Thanks.
>
> Frank.

Have a look at std.conv.parse




More information about the Digitalmars-d-learn mailing list