我有一组枚举值,需要将其转换为文本,然后再转换回集合。
我相信 TypInfo 单元的 GetSetProp 和 SetSetProp 允许执行此操作,但我不知道如何让它工作。关于如何使用 GetSetProp 和 SetSetProp 来完成此任务有什么想法吗?
type
TSomething = (sOne, sTwo, sThree, sFour, s Five);
TSomethings = set of TSomething;
var
Something: TSomethings;
s: string;
...
Something := [sOne, sThree];
s := GetSetProp(????);
Something := [];
// then use SetSetProp to set Something back to [sOne, sThree]
Something := ????
This 很棒的帖子设置到字符串,字符串到设置 http://tondrej.blogspot.com/2007/10/settostring-stringtoset.html by tondrej https://stackoverflow.com/users/11480/tondrej解决你的问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)