如何使用vb.net在richtextbox中定义空间 [英] How to define a space in richtextbox using vb.net

查看:139
本文介绍了如何使用vb.net在richtextbox中定义空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

姓名:穆罕默德

年龄:25

性别:男



我需要像


穆罕默德25岁男性





如果你看到,我想要穆罕默德应该是首先,之后在25(年龄)之前应该有7个空格,并且在25(年龄)和制作(性别)之间应该有12个空格



需要定义单词之间的空格数量?



值我将从文本框输入。

Name : Mohammed
Age : 25
Sex : Male

I need output like

Mohammed 25 Male


if you see, i want Mohammed Should be first, after that there should 7 white spaces before 25(age) and there should be 12 white spaces between 25(age) and Make(sex)

Need to define the number of white spaces between words?

Values i will get input from textbox.

推荐答案

为什么不使用PadRight?



带有第一,第二和第三字符串的示例。



first.PadRight( 15)+ second.PadRight(7)+ third



第一个字符串填充为15个字符,第二个字符串填充为7个字符,将其定位在列22(15 + 7 = 22)。
Why not use PadRight?

Example with strings called first, second and third.

first.PadRight(15) + second.PadRight(7) + third

The first string is padded out to 15 characters, the second string is padded out to 7 characters positioning it at column 22 (15 + 7 = 22).


这篇关于如何使用vb.net在richtextbox中定义空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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