vb編寫函式刪除字串中的特定字元

2022-01-31 22:23:06 字數 935 閱讀 6588

1樓:葛驕全蘆雪

vb.net

提供了格式化方法

如果資料型別是byte,

short,

integer,

long,

ulong:

a.tostring("d5")

如果資料型別是

integer,

decimal,

single,

double:

a.tostring("00000")

如果資料型別是string

iif(len(a)<

5,"00000".substring(0,5-len(a))+a,a)

2樓:

text1.text = replace(text1.text, text2.text, "")

將text1.text中的text2.text字元刪除

3樓:萍水e相逢

不難吧vb 有 好幾個字串 函式

編寫一個函式,其功能是刪除字串中指定的字元

4樓:宛丘山人

#include

#include

void delete(char data,char c)

5樓:默痕

不知道樓主問題是否解決,我最近也在學習這部分知識,遇到了這道題,這是我的**,希望能幫助到大家。如果有錯,還望大家指出並海涵。

6樓:123夏至

#include

#define n 100

void main(void)

;for (i=0;i

}for(i=0;i

編寫自定義函式,實現給定字串,得到字串的長度,並將其中的

include include char a 101 void f int n int main void f int n n for i 0 i n i printf n字串長度為 d n 1 測試 如果有不清楚的地方還請指出回我會改正答 設計函式實現將一個字串中的小寫字母轉化為大寫字母 char...

VB如何讀取字串中的指定字元

vb6.0使用mid 函式來讀取字串中指定數量的字元。mid 函式 返回 variant string 其中包含字串中指定數量的字元。語法 mid 函式示例 本示例使用 mid 語句來得到某個字串中的幾個字元。dim mystring,firstword,lastword,midwords myst...

用vb編寫程式for迴圈,讓使用者輸入字串,輸出這個字串中字母a和b出現

dim in str as string dim s1 as integer,s2 as integerin str inputbox 請輸入字串 for i 1 to len in str t mid in str,i,1 if t a or t b thenprint t if t a then...