MFCCString用法小结[定稿]
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
MFCCString用法小结[定稿]
第一篇:MFC CString 用法小结[定稿]
MFC CString 用法小结
1.初始化方法:
(1)直接复制,如Cstring=”mingrisoft”;
(2)通过构造函数初始化,如CString str(… ‟,100)//与分配100个字节,填充空格 char* p=”feiqiang”;Cstring(p);delete p.(3)加载工程中的字符串资源,如CString str;str.LoadString(IDS_STR);(4)使用CString类的成员函数Format初始化,如CString str;int i=0;str.Format(“value:%d”,i);
2.将CString转化为char*,如
CString str=”feqiang”;
char *p;p=str.GetBuffer();delete p;将char*转化为CString,如:char* p=”feiqiang”;
p[len(p)]=‟‟;
Cstring str(p);char* 和char数组的转化:
char buf[5] ={…a‟,‟b‟,‟c‟};
char *p;p=new char[5];p=buf;将字符串转化为数字:
CString str=”12”;
int i=atoi(str);long j=atoll(str);float f=atof(str);将数字转化为字符串:
CString str;int i=12;str.Format(“%d”,i);
long j=12;str,Format(“%ld”,j);
同理其他类型。
3.字符串的相关操作即方法的使用:
(1)提取字符串中的中文,如
CString
strtext,temp,strres;GetLlgItem(IDC_TEXT)->GetWindowT ext(strte xt);//通过ID获取编辑框中的文本
for(int =;i
if(IsDBCSLeadByte(ch)){ //判断字符是否是双字节编码的前一个字节tmp=strtext.Mid(i,2);//截取索引index1到index2的字符[)i++;stress+=tmp;}
GetLlgItem(IDC_RESULT)->SetWindowText(strtes);//设置文本框中的文本}(2)英文字符串首字母大写,如将以空格符分隔的英文单词的第一个字母大写(小写)str.GetAt(i);//提取字符串索引为i个字母str.MakeLower();//转化为小写
tmp.MakeUpper();//转化为大写
(2)按制定符号分割字符:
int pos=str.Find(strchar);//查找字符,如果没找到,则返回0,找到则返回字符的位置,参数可以是字符也可以是字符串
while(pos>0){ str1=str.Left(pos);//取左,参数为字符串的个数
str=str.Right(str.GetLength-pos-1);//取右,参数同上
tmp.Format(“%srn”,str1);//字符串中rn代表回车化行符
strres+=tmp;pos=str.Find(strchar);}(3)删除指定的中文: m_text.GetWindowText(strtxt);m_text.GetSel(istart,iend);//得到文本框中选中的文本,并且得到文本的头索引和尾索引if(istart==iend){ return;} str1=strtxt.Left(istart);if(iend>=strtxt.GetLength()){ str2=””;}el se{ str2=strtxt.Right(strtxt.GetLength()-iend);} strres+=str1;strres+=str2;(4)替换字符串:
strtxt.Replace(strchar,strnew);//用新串替换旧串
(5)根据CPoint查找位置:
CPoint pt;//获取字符串时获取鼠标所在字符串的位置
int pos=m_text.CharFromPos(pt);//根据pt获取字符串中的位置,即其左侧字符的位置 if(str.IsEmpty()){//判断字符串是否为空m_num.AddString(strres);//文本框追加字符串 } 将字符转化为大写:ch=ch-32;(6)字符串忽略大小写的比较:
CString str=”feiqiang”;
int com=pa reNoCase(“mingri”);//如果相等返回0,否则返回-1;
(7)连接换行符:CString str=”feiqiang t”;
(8)字符反转:str.MakeReverse();(9)取出首位空格:str.TrimLeft();str.TrimRight();取出字符串中的所有空格,str.Replace(“ ”,””);
(10)在ListBox中查找字符串
int
index=::SendMessage(m_stringlist.GetSafeHwnd(),LB_FINDSTRI NGEXACT,-1,(LPARAM)(LPCTSTR)strtext));//通过SendMessage函数向列表控件发送LB_FINDSTRINGEXACT消息来查找指定字符串是否在列表空间中,如果存在则返回索引位置。
(11)字符串数组:
CString str[5] array;CString str[5]={“feiqiang”,”mingri”,”mr”};
for(int i=0;i<5;i++){ array.Add(str[i]);//添加元素 } for(int j=0;j if(array.Get(j)==”mr”){
MessageBox(“存在”);} }(12)设置编码方式:Project/SettingsàPreprocessor,如果要使用DBCS,则添加_MBCS(多个字节编码),如果要使用Unicode,则添加_Unicode,不添加则使用ASCII.二字符串指针类型
(1)LPCSTR:32位静态字符串指针,可以直接赋值使用,如LPCSTR str=”mingrisofg”;(2)LPSTR:32位字符串指针,如LPSTR str;str=new char[256];(3)LPCTSTR:32位UNICODE型静态字符串指针,如LPCTSTR str=_T(“mingrisoft”);(4)LPTSTR: 32位UNICODE 型字符串指针,如LPTSTR str=new TCHAR[256];三 BSTR(进行COM 编程时使用的字符串类型)与CString之间的转化:1.对BSTR变量赋值时:BSTR bstr=NULL;bstr=SysAllocString(L”feiqang”);//从LPCWSTR构造
SysFreeString(bstr);//释放
将BSTR强制转化为CString,如:
CString str=(CString)bstr;或CString str;BSTR bstr=str.AllocSysString();2._bstr_(对BSTR的包装类),包含的头文件为:”COMDEF.H”
用法:
直接赋值:_bstr_t tbstr=”feqiang”;
给CString对象赋值:CString str=(LPCSTR)tbstr;//LPCSTR str=tbstr;将_bsr_转化为BSTR,使用copy函数:BSTR bstr=tbstr.copy();SysFreeString(bstr);BSTR之间赋值给_bstr_对象,如BSTR bstr=SysAllocString(L”mingri”);_bstr_t tbstr=bstr;四格式化类型
如:获取并且格式化系统时间
CTime t=CTime::GetCurrentTime();CSTring strtime=t.Format(“%H:%M:%S”);
MessageBox(strtime;1.CString::IsEmpty BOOL IsEmpty()const;返回值:如果CString 对象的长度为0,则返回非零值;否则返回0。
说明:此成员函数用来测试一个CString 对象是否是空的。
示例:
下面的例子说明了如何使用CString::IsEmpty。
// CString::IsEmpty 示例CString s;ASSERT(s.IsEmpty());请参阅CString::GetLength
2.CString::Left CString Left(int nCount)const;throw(CMemoryException);返回值:返回的字符串是前nCount个字符。
示例:
CString s(_T(“abcdef”));ASSERT(s.Left(2)== _T(“ab”));
3.CString::LoadString BOOL LoadString(UINT nID);throw(CMemoryException);返回值:如果加载资源成功则返回非零值;否则返回0。
nID 一个Windows 字符串资源ID。
说明:此成员函数用来读取一个由nID 标识的Windows 字符串资源,并放入一个已有CString 对象中。
示例:
下面的例子说明了如何使用CString::LoadString。
// CString::LoadString 示例
#define IDS_FILENOTFOUND 1 CString s;if(!s.LoadString(IDS_FILENOTFOUND))
4.CString::MakeLower void MakeLower();//改变字符的小写
5.CString::MakeReverse void MakeReverse();//字符倒置
6.CString::MakeUpper void MakeUpper();//改变字符的大写
7.CString::Mid CString Mid(int nFirst)const;CString Mid(int nFirst, int nCount)const;nCount代表要提取的字符数, nFirst代表要提取的开始索引位置示例:
CString s(_T(“abcdef”));ASSERT(s.Mid(2, 3)== _T(“cde”));
8.CString::ReleaseBuffer void ReleaseBuffer(int nNewLength =-1);参数:nNewLength 此字符串的以字符数表示的新长度,不计算结尾的空字符。
如果这个字符串是以空字符结尾的,则参数的缺省值-1 将把CString 的大小设置为字符串的当前长度。
说明:使用ReleaseBuffer 来结束对由GetBuffer 分配的缓冲区的使用。
如果你知道缓冲区中的字符串是以空字符结尾的,则可以省略nNewLength 参数。
如果字符串不是以空字符结尾的,则可以使用nNewLength 指定字符串的长度。
在调用ReleaseBuffer 或其它CString 操作之后,由GetBuffer 返回的地址是无效的。
示例:下面的例子说明了如何使用CString::ReleaseBuffer。
// CString::ReleaseBuffer 示例CString s;s = “abc”;LPTSTR p = s.GetBuffer(1024);strcpy(p, “abc”);// 直接使用该缓冲区ASSERT(s.GetLength()== 3);// 字符串长度= 3 s.ReleaseBuffer();// 释放多余的内存,现在p 无效。
ASSERT(s.GetLength()== 3);// 长度仍然是3
9.CString::Remove int CString::Remove(TCHAR ch);返回值:返回从字符串中移走的字符数。
如果字符串没有改变则返回零。
参数:ch 要从一个字符串中移走的字符。
说明:此成员函数用来将ch 实例从字符串中移走。
与这个字符的比
较是区分大小写的。
示例: // 从一个句子中移走小写字母'c': CString str(“This is a test.”);int n = str.Remove('t');ASSERT(n == 2);ASSERT(str ==“This is a es.”);10.CString::Replace int Replace(TCHAR chOld, TCHAR chNew);int Replace(LPCTSTR lpszOld, LPCTSTR lpszNew);返回值:返回被替换的字符数。
如果这个字符串没有改变则返回零。
参数:chOld 要被chNew 替换的字符。
chNew 要用来替换chOld 的字符。
lpszOld 一个指向字符串的指针,该字符串包含了要被lpszNew 替换的字符。
LpszNew 一个指向字符串的指针,该字符串包含了要用来替换lpszOld 的字符。
说明:此成员函数用一个字符替换另一个字符。
函数的第一个原形在字符串中用chNew 现场替换chOld。
函数的第二个原形用lpszNew 指定的字符串替换lpszOld 指定的子串。
在替换之后,该字符串有可能增长或缩短;那是因为lpszNew 和lpszOld 的长度不需要是相等的。
两种版本形式都进行区分大小写的匹配。
示例: // 第一个例子,old 和new 具有相同的长度。
CString strZap(“CnIn dex)时会出错,当nCount过大,没有足够的字符删除时,此函数不执行。
示例:
CString str1,str2,str3;char a;str1 = “nihao”;str2 = “nIhao”;int x;// int i=(str1 == str2);str1.Delete(2,3);如果nCount(3)> GetCount()– nIndex(5-2)就会执行错误
22.CString::Empty Void Empty();返回值:没有返回值清空操作;示例:
CString s(“abc”);s.Empty();ASSERT(s.GetLength()== 0);
23.CString::Find int Find(TCHAR ch)const;int Find(LPCTSTR lpszSub)const;int Find(TCHAR ch, int nStart)const;int Find(LPCTSTR lpszSub, int nStart)const;返回值: 不匹配的话返回-1;索引以0 开始;nStar 代表以索引值nStart 的字符开始搜索 , 即为包含以索引nStart字符后的字符串.示例:
CString s(“abcdef”);ASSERT(s.Find('c')== 2);ASSERT(s.Find(“de”)== 3);Cstring str(“The stars are
aligned”);Ing n = str.Find('e',5);ASSERT(n == 12)
24.CString::FindOneOf int FindOneOf(LPCTSTR lpszCharSet)const;返回值: 不匹配的话返回-1;索引以0 开始注意::返回此字符串中第一个在lpszCharSet中也包括字符并且从零开始的索引值示例:
CString s(“abcdef”);ASSERT(s.FindOneOf(“xd”)== 3);// 'd' is first match.25.CString::Format void Format(LPCTSTR lpszFormat,...);void Format(UINT nFormatID,...);参数:lpszFormat 一个格式控制字符串nFormatID 字符串标识符示例:CString str;Str.For mat(“%d”,13);此时Str为13
26.CString::GetAt TCHAR GetAt(int nIndex)const;返回值:返回标号为nIndex的字符,你可以把字符串理解为一个数组,GetAt类似于[].注意nIndex的范围,如果不合适会有调试错误。
27.CString::GetBuffer LPTSTR GetBuffer(int nMinBufLength);返回值:一个指向对象的(以空字符结尾的)字符缓冲区的LPTSTR 指针。
参数:nMinBufLength 字符缓冲区的以字符数表示的最小容量。
这个值不包括一个结尾的空字符的空间。
说明:此成员函数返回一个指向CString 对象的内部字符缓冲区的指针。
返回的LPTSTR 不是const,因此可以允许直接修改CString 的内容。
如果你使用由GetBuffer 返回的指针来改变字符串的内容,你必须在使用其它的CString 成员函数之前调用ReleaseBuffer 函数。
在调用ReleaseBuffer 之后,由GetBuffer 返回的地址也许就无效了,因为其它的CString 操作可能会导致CString 缓冲区被重新分配。
如果你没有改变此CString 的长度,则缓冲区不会被重新分配。
当此CString 对象被销毁时,其缓冲区内存将被自动释放。
注意:如果你自己知道字符串的长度,则你不应该添加结尾的空字符。
但是,当你用ReleaseBuffer 来释放该缓冲区时,你必须指定最后的字符串长度。
如果你添加了结尾的空字符,你应该给ReleaseBuffer 的长度参数传递-1,ReleaseBuffer 将对该缓冲区执行strlen 来确定它的长度。
示例:
// CString::GetBuffer 例子 CString s(“abcd”);#ifdef _DEBUG afxDump << “CString s ” << s << “n”;#endif LPTSTR p = s.GetBuffer(10);strcpy(p, “Hello”);// 直接访问CString 对象。
s.ReleaseBuffer();#ifdef _DEBUG afxDump << “CString s ” << s << “n”;#endif
28.CString::GetLength int GetLength()const;返回值:返回字符串中的字节计数。
说明:此成员函数用来获取这个CString 对象中的字节计数。
这个计数不包括结尾的空字符。
对于多字节字符集(MBCS),GetLength 按每一个8 位字符计数;即,在一个多字节字符中的开始和结尾字节被算作两个字节。
示例下面的例子说明了如何使用CString::GetLength。
// CString::GetLength 示例CString s(“abcdef”);ASSERT(s.GetLength()== 6);
29.CString::Insert int Insert(int nIndex, TCHAR ch);int Insert(int nIndex, LPCTSTR pstr);返回值:返回修改后的长度,nIndex是字符(或字符串)插入后的索引号例子示例:
CString str(“HockeyBest”);
int n = str.Insert(6, “is”);
ASSERT(n == str.GetLength());printf(“1: %sn”,(LPCTSTR)str);n = str.Insert(6, ' ');ASSERT(n == str.Get Length());printf(“2: %sn”,(LPCTSTR)STR);
n = str.Insert(555, …1‟);
ASSERT(n == str.GetLength());printf(“3: %sn”,(LPCTSTR)str);输出
1.Hockeyis Best
2.Hockey is Best
3.Hockey is Best!
第二篇:it用法小结
小结(2008-12-08 15:57:31)
标签:教育
It用法小结
it在英语语法中属人称代词,意思是“它”,用来指人以外的一
切生物和事物。
它的用法不仅不简单,而且很复杂。
一、用于指人以外的一切生物、无生命的东西和事情。
一般指说话者心目中已经了解或所指的生物、无生命的东西或事情、没有性别的区分;可以是可数名词,也可以是不可数名词,在句子中既可做主语,也可以作宾语。
1.指动物和植物。
如:
—Oh,that's Lucy's hat.噢,那是露茜的帽子。
—It looks like a cat!它看上去像只猫!
Where's tea grown?It's grown in the southeast of China.
什么地方种植茶?中国东南部种植茶。
2.指代一些无生命的东西。
如: Is it your watch?这是你的手表吗?
Look at the rain!It's heavy,isn't it?看这雨!雨很大,对吗?3.代替上文提到过的整个事情。
如:
Well,you mustn't play on the road.It's dangerous.哦,你不能在公路上玩。
这太危险了!It was hard work,but they really enjoyed it.摘苹果是艰苦活,可他们都乐意去干(它)。
二、用于指代人。
1.指代说话者心目中不太清楚的那个人,常在打电话或敲门时用。
如:
—Who was it?是谁(打来的电话)?—Was it Susan?(打电话的)是苏珊吗?
—Yes,it was.是的,我是。
(根据上下句,“it was”也可不译出来。
)再如:—Who is knocking at the door?谁在敲门?
—It's me.是我。
2.指说话者心目中的那个人。
如:
—Is it your sister,Kate?(那旧照片上的 baby)是你姐姐凯特吧?
—No!不是。
—Is it your brother?是你哥哥吧?
—No!不是。
—I know—it's you!我知道了,(那)是你。
3.指代性别不详的婴幼儿或在不计较性别时,也可用it来指人。
如 The child smiled when it saw its mother.这小孩一见到母亲就笑了。
I don't know who it is.我不知道他是谁。
注意:看到这样的句子(或听到这样的话)时,要想一想,不要一看到it就把它译成“它”。
)4.在回答用指示代词表示人的特殊问句时,常用it指人。
如:
—Who's that?那人是谁?
—Is it Kate?是凯特吗?
—Yes,I think you're right.It's Kate.是的,我想你说对了,是凯特。
三、用于指时间、距离和自然现象等。
1.表示时间。
如:
—What time is it?几点钟?
—It's ten.十点钟。
It's summer in Australia now.现在澳大利亚是夏天。
特别注意it用于表示时间时还常见于以下两个句型中:(1)It's time(for sb.)to do sth./It's time for sth.译为“是(某人)该干……的时间了”、“到……的时候了”。
如:
It's time for supper/to have supper.是吃晚饭的时候了。
I think it's time for us to start the lesson now.我想现在是我们开始上课的时候了。
(2)It is /has been +时间段+since +一般过去时。
译为“自从……以来已过了……(时间)”。
此结构可以与另一种句型进行同义句转换。
如:
It has been two weeks since we met last.= Two weeks has passed since we met last.自从我们上次相遇以来,两个星期过去了。
It's three years since he came here.=It has been three years since he came here.=He has been here for three years.他到这里已经三年了。
2.表示距离。
如:
It's half an hour's walk from my home to the school.从我家到学校步行得花半小时时间。
—Where's the farm,Li Lei?Is it far?李雷,农场在哪里?远吗?
—No,it's quite near.不,(距)离这很近。
3.表示自然现象。
如:
Sometimes it snows and the land is all white.有时下雪,大地一片白。
It is very quiet here at the moment.眼下这儿很安静。
四、用作形式主语。
英语中常常见到某个句子以it开头,it与其后面的动词不定式短语、动名词短语、名词性从句等相呼应,以表达一个完整的意义。
这是一种习惯表达法,这样的句式可避免句子显得头重脚轻。
1.It+is/was+形容词+(for/of sb.)+动词不定式短语。
对于这个句型中究竟用for还是用of,一般遵循这样的规则:如果形容词仅仅是描述事物的形容词,如:difficult,easy,hard,important,dangerous等用for;如果形容词是描述不定式行为者的性格、品质的,如:kind,good,nice,clever等则用of。
如:It is interesting to play with snow in winter.冬季里玩雪是很有趣的。
It's important for us to keep the water clean.保持水质清洁对我们来说是很重要的。
It's very kind of you to say so.你这样说真是太好了。
注意:这一句式中的形容词位置也可换用名词;连系动词be 也可换用其它连系动词,如feel等。
如:
It's a good habit to get up early and go to bed early.早睡早起是好习惯。
It must be great fun to fly to the moon in a spaceship.乘宇宙飞船飞往月球一定很有趣。
It feels strange to have a twin sister.有个孪生姐妹感觉很奇怪。
2.It +will be/is /was +形容词+动名词短语。
如: It's bad playing in the street.在街上玩是没好处的。
Is it any good trying again?再试一次有用吗? 3.It+is/was+形容词+从句。
如:
It is certain that he will come.他一定会来。
It's true that he may fall behind the other students.他真的可能落后于其他同学。
It is strange that he should say so.他居然这么说,真是奇怪。
4.It +is /was +one's turn(duty,pleasure)+to do sth.意为“该轮到某人做某事(做某事是某人的责任、愉悦的事)”。
如:
It's your turn to be on duty tomorrow.明天轮到你值日了。
5.It takes(sb.)some time to do sth.意为“(某人)花……时间做某事”。
如 It took me a week to finish reading the book.我花了一周时间看完这本书。
6.It +cost/costs +sb.+some money +to do sth.译为“某人花多少钱做某事”。
如: It cost me 260 yuan to buy the new watch.我买这块新手表花了260元。
7.It seems /seemed +从句。
译为“看起来好像……”,此结构可以转换成“seem +动词不定式”形式。
如:
It seems that he is ill.=He seems to be ill.看起来他好像病了。
[原题再现] ①________is a fact that English is being accepted as an international language.A.There B.This C.That D.It ② In fact________ is a hard job for the police to keep order in an important football match.A.this B.that C.there D.it 答案: ① D ② D
五、用作形式宾语。
当句子的真正宾语是动词不定式、动名词或从句时,为避免句子头重脚轻,须将其放在宾语补足语之后,改用先行词it占据其原来的位置。
it用作形式宾语的句型为:主语+谓语+it+宾语补足语+动词不定式/动名词/从句。
该句型中宾语补足语可由形容词、名词等充当。
如:
He found it not easy to learn a foreign language well.他发现学好一门外语是不容易的。
We think it no good reading in bed.我们认为躺在床上看书无益处。
I think it necessary that we have the meeting.我认为开这个会是必要的。
[原题再现] Don't ________that all those who get good grades in the entrance
examination will prove to be most successful.A.take as granted
B.take this for granted
C.take that for granted
D.take it for granted 答案: D
六.构成强调句。
如:
It was in the street that I saw Li Ping this morning.今天早晨,就是在街上我看见李明。
[原题再现] ________was in 1979________I graduated from university.A.That;that B.It;that C.That;when D.It;when 答案: B 七.构成特殊句式。
如:
It seems as if we should finish it tomorrow.【练习】
(1)There is a photo on the wall.____ the photo of Lei Feng.A.It B.Its C.It's D.He(高考,1980)(2)Is_necessary to tell his father everything? A.it B.that C.what D.he(MET1987)(3)Is_possible to fly to the moon in a spaceship? A.now B.man C.that D.it(4)I consider____ my duty to help you. A.it B.this C.that D.its(5).It was at four o'clock in the afternoon ____ he and his grandpa reached the museum in Guanghan.A.while B.that C.when D.as 答案:(1)C(2)A(3)D(4)A(5)B(6).I like ____ in the autumn when the weather is clear and bright.(2004全国I)A.this B.that C.it D.one(7).-Do you like ___ here?-Oh,yes.The air,the weather,the way of life.Everything is so nice.(2004全国II)A.this B.these C.that D.it(8).The Parkers bought a new house but ____ will need a lot of work before they can move in.A.they B.it C.one D.which(9).I hate___ when people talk with their mouths full.A.it B.that C.these D.them(10).Joan had often heard____ said that Marley had no money.A.it B.this C.that D.one 答案:C D B A A
八、it, one和that作替代词的用法及区别
it, one和that虽然都可以用来替代前面所提到的一个单数名词,以避免重复,但在具体用法上却有不同。
简述如下: 1.it代替前面提到的同一事物,该事物既可以是可数名词也可以是不可数名词。
[原题再现]
The news that they failed their driving test discouraged him, ______? A.did they B.didn't they C.did it D.didn't it 答案: D 2.one代替前面提到的同类事物中的一个。
该事物只能是可数名词,前面可以有冠词,也可以被this、that或形容词修饰,其后也可以有定语。
[原题再现]-Why don't we have a little break?-Didn't we just have________?
A.it
B.that
C.one
D.this 答案: C 3.that代替前面提到的同类事物中特指的一个。
该事物既可以是可数名词也可以是不可数名词,要有后置定语,但不可以有前置修饰语。
[原题再现] Few pleasures can equal ________ of a cool drink on a hot day.A.some B.any C.that D.those 答案: C
高考“it”的用法英语题
历届高考英语单项选择题精选
(一)“it”的用法
1.Was it during the Second World War_____ he died?
A.that
B.while
C.in which
D.then
(88)2.Is ____ necessary to complete the design before National Day? A.this
B.that
C.it
D.he
(89)3.I dont think ____ possible to master a foreign language without much memory work.A.this
B.that
C.its
D.it
(91)4.Does ______ matter if he can’t finish the job on time?
A.this
B.that
C.he
D.it
(91)5.It was not _____ she took off her glasses _____ I realized she was a famous film star.A.when , that B.until , that C.until , that
D.when , then
(92)6.I was disappointed with the film.I had expected ______ to be much better.A.that
B.this
C.one
D.it
(93)7.It was not until 1920 ______ regular radio broadcasts began.A.while
B.which
C.that
D.since
(94)8.______is a fact that English is being accepted as an international language.A.There
B.This
C.That
D.It
(95)9.It was only when I reread this poems recently _____ I began to appreciate their beauty.A.until
B.that
C.then
D.so
(97)10.I hate _____ when people talk with their mouths full.A.it
B.that
C.these
D.them
(98)11.It is the ability to do the job _____ matters not where
you come from or what you are.A.one
B.that
C.what
D.it
(2000)KEYS: 1-5 ACDDB 6-10 DCDBA 11 B
’
第三篇:as用法小结
as虽小,功能强大
as是英语中意义广泛、用法灵活且复现率极高的词, 每年高考命题和其他各级命题都会从不同角度对其进行考查。
它在词性上有介词、连词和代词等,主要有以下用法。
一、作介词
表示“作为,当作;以……身份”,其后常接名词。
例如:Johnson works as a doctor.约翰逊(的职业)是个医生。
I like him as a person, but I don’t think much of him as s writer.作为一个普通人,我是喜欢他的,但是作为一名作家,我对他的评价并不高。
Wang Baoqiang’s talents as a film actor were soon recognized.作为电影演员,王宝强的天才很快得到了赏识。
【注意】as和like都可以作介词,但意义不同。
as表示“以实际的身份或地位”,like则表示“与……相似,以与……相类似的方式”。
例如:He has been playing tennis as a professional for five years.(= he is a professional)他作为一名职业选手已经打了五年网球了。
He plays tennis like a professional.(= he is not a professional but he plays as well as a professional)他打网球就像职业选手一样。
二、作连词
as作连词时,用法比较多,可以引导时间状语从句、原因状语从句、方式状语从句、让步状语从句等。
(一)as引导时间状语从句
表示主句和从句的动作同时发生,并具有延续的含义,意思是“正当……的时候;随着……”。
例如:Tom caught sight of Jenny as he was getting off the train.正当汤姆下火车的时候,他看见珍妮了。
As the election approaches, the situation in Libya is getting worse and worse.随着大选的临近,利比亚局势越来越糟糕。
【注意】as与when,while都是引导时间状语从句的从属连词,含义都是“当……的时候”。
但它们有区别:as和when引导的从句可以表示一个短暂性的动作,也可以表示一个持续性的动作;用when 时,从句的动作可以与主句的动作同时发生,也可以先于主句的动作发生;但若要表示两个正在发展变化的情况时,一般用as,表示“随着……”。
用while时,主句动作与从句动作同时进行或在从句动作过程中发生,从句动词必须是延续性的。
(二)as引导原因状语从句
as一般放在句首,语气较弱,较口语化。
例如:As she has no car, she can’t get the station easily.因为她没有车,去车站不容易。
As it is raining, we shall not go the park.由于天在下雨,我们不去公园了。
【注意】as和because,since都可以表示因果关系,但它们有区别:because表示的语气最强,当用于由why提问的句子回答时,必须用because作答;since常常用在书面语中,表示多为对方已知的、或稍加分析便可得知的原因,有时可译作“既然”。
例如:Tom was absent from the opening ceremony because he was ill.因为他生病了,汤姆没有参加开幕式。
--Why can’t I go skiing? 为什么我不能去?--Because you’re too young.因为你太年轻了。
He must have shut the door since he was the last one to leave.他肯定关门了,因为他是最后一个离开的。
Since you can’t answer the question, perhaps we’d better ask someone else.既然你不能回答这个问题,我们也许该问问别人。
(三)as引导让步状语从句
as所表示的语气较强,意思是“虽然”,它引导的让步状语从句用倒装语序。
倒装语序主要有以下三种形式:
1.形容词或副词+as+主语+(连系动词)be或实义动词。
例如:Rich as he is, he never spends a cent on clothes.虽然他很富有,但他从不花一分钱买衣服。
Much as I admire his courage, I don’t think he acted wisely.我虽然佩服他的勇气,但我认为他这样做是不明智的。
Hard as I studied, I couldn’t catch up with others in class.我虽然努力学习,但赶不上班里其他同学。
2.名词+as+主语+(连系动词)be(注意:句首的名词不带冠词)。
例如:Child as he is, he knows a lot about physics.尽管他是个孩子,但对物理知道不少。
3.实义动词+as+主语+助动词,如果没有助动词,则要加上一个do(does或did。
例如:Try as he may, he never succeeds.尽管他很努力,但总是不成功。
Search as they would here and there, they could find nothing in the room.尽管到处寻找,但他们在房子里找不到任何东西。
【注意】这种倒装结构中,as可以用though替换,但是不能用although,在运用时要特别注意。
(四)as引导方式状语从句
意思是“如”,“像”,“按照……的方式”。
例如:Remember, you must do everything as I do.记住,你必须按照我做的那样做一切。
(五)as…as…的用法
as...as…意为“和……一样……”,表示同级的比较。
使用时要注意第一个as为副词,第二个as为连词。
其肯定结构为:as+ adj./ adv.+as…;否定结构为:not as/so +adj./ adv.+as…。
例如:This film is as interesting as that one.这部电影和那部电影一样有趣。
He can speak English as fluently as a native.他说英语和当地人一样流利。
This dictionary is not as/so useful as you think.这本字典不如你想象的那样有用。
【注意】若有修饰成分,如twice, three times, half, a quarter等,则须置于第一个as之前。
例如:Your car is twice as expensive as mine.你的汽车比我的贵一倍。
三、作代词
as作代词时,常用于引导定语从句,主要有以下结构:1.用于the same...as,such...as等结构中
例如:This is the same book as I read last week.这本书和我上周读的那本是一样的。
I don’t like such books as he recommends.我不喜欢他推荐的那些书。
2.用于“so/as +adj.+ a/an + n.(单数)+ as”结构中
The man is not so/as healthy a man as he was.那个人已经没有从前那么健康了。
3.as引导非限制性定语从句时,所指代的内容通常指整个结构;在句子中位置比较灵活,可以在句首、句中或句末。
例如:She is late, as is often the case.她迟到了,这是经常的事。
(先行词是整个主句)To shut your eyes to facts, as many of you do, is foolish.视而不见是愚蠢的,好多人都是如此。
(先行词是不定式短语)David, as you know, is a famous actor.你是知道的,大卫是著名的演员。
【注意】当修饰句子的非限制性定语从句位于句末时,as可以用which来替代。
但是,当as从句位于句首或句中时,as就不能用which来替代了。
例如:I live a long way from work, as(which)you know.我住得离工作单位很远,这你是知道的。
As you will find out, I will never let you down.你将会发现,我绝不会使你失望的。
Taiwan, as you know, is an inseparable part of China.你们知道,台湾是中国不可分割的一部分。
【注意】as引导非限制性定语从句时,常用于一些固定结构中。
如:as we all know/as is known to all大家都知道;as is often the case情况就是这样;as is said/mentioned above/as has been said before如上所述;as can be seen大家看到;as is/was expected/as
we expect正如预料;as I can remember我能记住
四、与as相关的固定搭配
as good as差不多,几乎;和……一样好
as soon as 一……就…… as long as只要
as well as同(一样也);和;还as far as I’m concerned 据我所知 as if/as though似乎;好像
such…as, such as像……这样的;比如as to关于某事物;提到某事物 so as to...为了
as a matter of fact其实;实际上
as a result,as a result of由于……的结果
总之,as虽小,功能却很强大。
通常考查其和when, while, since, though, although, which等的辨析以及词组as far as, as soon as, as long as, as well as, as if/though等的用法。
通过以上的分析,我们对as的词性和用法有了比较全面的理解和把握,在实际的运用中就能做到心中有数,应付自如。
第四篇:there be 用法小结
there be 用法小结
1.基本结构
There be + 主语 + 地点/ 时间状语。
如:
There is a computer in the room.房间里有一台电脑。
There are two TV plays every evening.每晚有两场电视剧。
2.主谓一致
要采取就近一致原则,和靠近be 的主语一致。
如:
There is a pen, two rulers in the box.盒子里有一只钢笔,两把尺子。
There are two boys and a teacher at the school gate.门口有两个男孩,一个老师。
3.主语后的动词形式
在there be 句型中,主语与动词是主动关系时用现在分词;是被动关系时用过去分词。
如:
There is a purse lying on the ground.地上有一个钱包。