删除空格和制表符 [英] Removing white spaces and tab characters

查看:106
本文介绍了删除空格和制表符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有这样的文字 -

"这是一条包含标签和空格的消息


现在这个文本包含制表符和空格。我想删除选项卡

和空格(如果两个单词之间不止一次)。


C中是否有任何函数可以找到超出选项卡和

空格并以下列方式返回文本 -


"这是一条包含标签和空格的消息"


欢迎提供任何代码帮助..


等待回复


Gopal Srinivasan

Hi,

I have a text like this -
"This is a message containing tabs and white spaces"

Now this text contains tabs and white spaces. I want remove the tabs
and white spaces(if it more than once between two words).

Is there any function we have in C which will find out the tabs and
white spaces and returns the text in the follwong way -

"This is a message containing tabs and white spaces"

Any code help is welcome..

Awaiting the response

Gopal Srinivasan

推荐答案

gopal srinivasan写道:
gopal srinivasan wrote:


我有这样的文字 -
;这是包含标签和空格的消息

现在,此文本包含标签和空格。我想删除选项卡
和空格(如果两个单词之间不止一次)。

我们在C中是否有任何功能可以找出标签和
白色空格并以下列方式返回文本 -

这是包含标签和空格的消息

欢迎任何代码帮助..

等待回复

Gopal Srinivasan
Hi,

I have a text like this -
"This is a message containing tabs and white spaces"

Now this text contains tabs and white spaces. I want remove the tabs
and white spaces(if it more than once between two words).

Is there any function we have in C which will find out the tabs and
white spaces and returns the text in the follwong way -

"This is a message containing tabs and white spaces"

Any code help is welcome..

Awaiting the response

Gopal Srinivasan




不,你必须自己写。

-

Thomas Matthews


C ++新闻组欢迎辞:
http://www.slack.net/~shiva/welcome.txt

C ++常见问题: http://www.parashift.com/c++-faq-lite

C常见问题: http:/ /www.eskimo.com/~scs/c-faq/top.html

alt。 comp.lang.learn.c-c ++ faq:
http:// www.comeaucomputing.com/learn/faq/

其他网站:
http://www.josuttis.com - C ++ STL图书馆书



No, you will have to write your own.
--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book


gopal srinivasan在03/09写道/ 04:
gopal srinivasan wrote on 03/09/04 :
我有这样的文字 -
这是一条包含标签和白色
空格的消息

现在这个文字包含标签和空格。我想删除选项卡
和空格(如果两个单词之间不止一次)。

我们在C中是否有任何功能可以找出标签和
白色空格并以下列方式返回文本 -
I have a text like this -
"This is a message containing tabs and white
spaces"

Now this text contains tabs and white spaces. I want remove the tabs
and white spaces(if it more than once between two words).

Is there any function we have in C which will find out the tabs and
white spaces and returns the text in the follwong way -




编号一些扫描循环和智能使用isspace()函数

(< ctype.h>)可能有助于自己编写。


如果您遇到困难,请发布您的代码。我们不做家庭作业(好吧,免费赠送
)。


-

Emmanuel

C-FAQ: http:// www .eskimo.com / ~scs / C-faq / faq.html

C库: http://www.dinkumware.com/refxc.html


C是一个尖锐的工具



No. Some scan loop and a smart use of the isspace() function
(<ctype.h>) may help to write your own.

Post your code if your are stuck. We don''t do homeworks (well, for
free).

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"C is a sharp tool"


2004年9月3日星期五,gopal srinivasan写道:
On Fri, 3 Sep 2004, gopal srinivasan wrote:

我有这样的文字 -
这是一条包含标签和空格的消息

现在这个文本包含标签和空格。我想删除选项卡
和空格(如果两个单词之间不止一次)。

我们在C中是否有任何功能可以找出标签和
白色空格并以下列方式返回文本 -

这是一条包含标签和空格的消息
Hi,

I have a text like this -
"This is a message containing tabs and white spaces"

Now this text contains tabs and white spaces. I want remove the tabs
and white spaces(if it more than once between two words).

Is there any function we have in C which will find out the tabs and
white spaces and returns the text in the follwong way -

"This is a message containing tabs and white spaces"




不,那里这样做没有标准的C函数。写一个函数来做这件事并不是太难了。试试吧,如果你的b $ b有问题,请发布你的代码。


-

发送电子邮件至: darrell at cs dot toronto dot edu

不要发送电子邮件至 vi************@whitehouse.gov


这篇关于删除空格和制表符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆