std::string stdTemp;CString strTemp;strTemp = stdTemp; ;//这一步直接赋值可不可以因为CString可以接受const char*的赋值,而且std::string有个返回const char*的方法,c_str(),所以,应该这样写:str....
分类:
其他好文 时间:
2015-03-12 23:50:07
阅读次数:
176
Java中的 String 类有个trim() 可以删除字符串前后的空格字符,jQuery中也有trim()方法可以删除字符变量前后的字符串。但是JavaScript中却没有相应的trim() 方法,幸好,JavaScript中有正则表达式,String 对象有replace() 方法,利用JavaScript的正则和replace方法来达到trim() 方法的效果。
接下来介绍两种方法,其实两种方法大同小异。都是在String 对象的prototype属性上进行trim()方法的定义,并提供实现,实现后...
分类:
编程语言 时间:
2015-03-12 22:35:52
阅读次数:
184
界面跳转后内容回调 or
内容回传
前一个界面给后一个界面传递消息
让跳转的intent携带参数:
1. 在第一个界面:intent封装数据
it.putExtra("msg",
"吧啦啦啦");
2.在第二个界面取出数据
//取出数据方法:保证是获取前一界面的同一个it对象。
Intent it=getIntent();
//取出数据
String msg=...
分类:
移动开发 时间:
2015-03-12 22:32:41
阅读次数:
193
LINQ 联查多表数据并封装到ViewModel的实现 public List GetPagedTaskList(int pageIndex, int pageSize, string stuNum, int taskTypeId) { DbSet taskParticipations = db.S...
分类:
其他好文 时间:
2015-03-12 22:19:10
阅读次数:
111
#include"iostream"#include"stdio.h"#include"algorithm"#include"string.h"#include"queue"#include"cmath"int homework[10005][105];int n,l,m;int count[100...
分类:
其他好文 时间:
2015-03-12 22:10:58
阅读次数:
136
C#6.0主要提供了一些语法糖,另外还提供了新的编译器Roslyn地址https://github.com/dotnet/roslyn一下列举几个新增的语法糖:1.构造一个类:public class A{ public long ID{get;set;}=1; public string Na.....
输入一个日期判断是否正确: Console.WriteLine(" 请按照格式正确输入年月日(yyy/MM/dd)"); string a = Console.ReadLine(); DateTime dt =...
1.is——判断对象/类是否属于某一类,返回布尔值例:123 is Number返回:true例:int is Object返回:true2.as——判断对象/类是否属于某一类,成功返回对象本身,失败返回null例: 123 as uint返回:123例:123 as string返回:null注:...
分类:
其他好文 时间:
2015-03-12 20:44:02
阅读次数:
112
#include
#include
#include
using namespace std;
class AbstractFile{
protected:
string name;
public:
AbstractFile(string n){
name=n;
}
virtual void Display()=0; // 纯虚函数
...
分类:
编程语言 时间:
2015-03-12 19:22:21
阅读次数:
183
插入Emoji表情,保存到数据库时报错:
SQLException: Incorrect string value: '\xF0\x9F\x98\x84' for column 'review' at row 1
UTF-8编码有可能是两个、三个、四个字节。Emoji表情是4个字节,而Mysql的utf8编码最多3个字节,所以数据插不进去。...
分类:
其他好文 时间:
2015-03-12 19:14:06
阅读次数:
460