博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wxstring与其他类型转换
阅读量:7100 次
发布时间:2019-06-28

本文共 1228 字,大约阅读时间需要 4 分钟。

wxstring与其他类型转换

 

1 1.1 int to wxString:     2 wxString str = wxString::Format(wxT("%i"),myInt); 3 1.2   wxString to int :      4 int i; i = wxAtoi(str); 5 1.3   string to wxString:     6 std::string stlString = "sdfas"; wxString mystr(stlString .c_str(),wxConvUTF8); 7 1.4   wxString to string:     8 wxString mystring(wxT("HelloWorld")); 9 std::string stlstring = std::string(mystring.mb_str());10 1.5  char* to wxString:11 char* chars = "Hello world";12 wxString mystring(chars, wxConvUTF8);13 1.6   wxString to  char*:   14 char* cs = str.mb_str(wxConvUTF8);15 法2:wxString to UTF-8 to char*(即string)16 wxString wx;const wxCharBuffer wxc = wx.ToUTF8(); const char *wxs= wxc;17 1.7    char[] to wxString:18 char chars[34] = "sefasd";19 wxstring mystring(chars, wxConvUTF8);20 1.8  wxString to char[]:21 wxString mystring(wxT("HelloWorld"));22 char cstring[1024];23 strcpy(cstring, (const char*)mystring.mb_str(wxConvUTF8));24  25 wxdatetime 与wxstring转换26 2.1  wxdatetime to wxstring :27 wxDateTime dt = CalendarCtrl1->GetDate();28 wxString msg = dt.Format(wxT("%Y-%m-%d"),wxDateTime::A_EST);29 2.2 wxstring to wxdatetime:   char* ca = "2008-09-03";wxDateTime dt;dt.ParseDate(ca);

 

 

 

 

转载于:https://www.cnblogs.com/starf/p/3657149.html

你可能感兴趣的文章
2007浙大复试上机考试题目3--游船出租
查看>>
Tomcat Manager配置
查看>>
Solve Error: 'has incomplete type', foward declaration of 'class x'
查看>>
[异常解决] ubuntu上安装JLink驱动遇到的坑及给后来者的建议
查看>>
codechef Arranging Cup-cakes题解
查看>>
Linkedin工程师是如何优化他们的Java代码的
查看>>
C语言程序的存储区域
查看>>
C#子类访问基类成员
查看>>
[LeetCode] Sort List
查看>>
解决ubuntu eclipse中 Android SDK Manager 图标不见的方法
查看>>
Java maven安装GDAL
查看>>
初始化对象的几种情况
查看>>
can't able to update the design capacity in bq27441-G1
查看>>
数据结构学习笔记【持续更新】
查看>>
2018AI行业地图丨CB Insights:这100家AI初创公司募资额超百亿
查看>>
【bootstrapValidator 不验证】使用bootstrapValidator 验证效果不起作用
查看>>
机器学习中的算法(1)-决策树模型组合之随机森林与GBDT
查看>>
easyui datagrid 列的内容超出所定义的列宽时,自动换行
查看>>
jenkins构建一个maven项目[五]
查看>>
Python调用C/C++程序
查看>>