你好,,,,在段落中的单词或术语之间如何间隔 [英] hello ,,,,, how space between words or terms in paragraph

查看:42
本文介绍了你好,,,,在段落中的单词或术语之间如何间隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
文本文件空间中的单词之间的空格的代码是什么= 20空白,请在vb.net2010

hello
what is the code for space between words in text file space =20 blank please answer in vb.net2010

推荐答案

中回答.那么可以使用以下代码
If you want fix the width of each column of text, then the following code can be used
Dim animals As String() = New String() {"Cat", "Dog", "Horse"}
Dim fruits As String() = New String() {"Apple", "Banana", "Grapes"}

Dim line As String
Dim sb As New StringBuilder()
Dim spaces As New String(" "C, 20)

Dim i As Integer = 0
While i < animals.Length AndAlso i < fruits.Length
'20 in {0,20}, defines the width of the column
'If it is negative i.e. -20, then the text is left aligned
'within the column otherwise it is right aligned in the column
	'line = String.Format("{0,20}{1,20}" & vbLf, animals(i), fruits(i))
	line = String.Format("{0,-20}{1,-20}" & vbLf, animals(i), fruits(i))
'If 20 spaces are to be introduced between two words then
'the following code can be used.
	'line = String.Format("{0}{1}{2}" & vbLf, animals(i), spaces, fruits(i))
	sb.Append(line)
	i += 1
End While
System.IO.File.WriteAllText(fileName, sb.ToString())


您应该在vb.net的字符串操作的帮助下编写自己的代码,并且文件处理.

如果您在任何时候遇到问题,都可以询问.....
You should write your own code , with the help of string operation of vb.net , and file handling.

If you having problem at any point , you can ask .....


这篇关于你好,,,,在段落中的单词或术语之间如何间隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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