从字符串中删除空格 [英] Remove white space from string

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

问题描述

我想删除位于 \\\
之后的空白。 例如, username 123\\\
ugas 423\\\
peter 23\\\
asd234
会变成用户名123\\\
ugas 423\\\
peter 23\\\
asd234

解决方案

f [] = []
f '\\\
':'':a)= f('\\\
':a)
f(a:b)= a:fb


I would like to remove the whitespace located after \n.

For instance, username 123\n ugas 423\n peter 23\n asd234 would become username 123\nugas 423\npeter 23\nasd234.

解决方案

f [] = []
f ('\n':' ':a) = f ('\n' : a)
f (a:b) = a : f b

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

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