Home » Windows API

CharUpper

說明:
CharUpper 函式可將字串或字元轉為大寫


引用函式庫:
User32


適用系統:
Windows NT 3.1 或 Windows 95以上


函式原型:

Declare Function CharUpper Lib "user32" Alias "CharUpperA" ( _
    ByVal lpsz As String _
    ) As String



參數型態及說明:
lpszString 要轉換的字串或字元

回傳值:
String 回傳轉換後的字串或字元

.NET Framework API:
System.String.ToUpper

VB範例:

檢視原始碼 Visual Basic
1
2
3
4
5
6
7
8
9
'VB的宣告
Private Declare Function CharUpper Lib "user32" Alias "CharUpperA" ( _
	ByVal lpsz As String _
	) As String
 
Dim rtvl As String
 
'把abcdefg轉大寫
rtvl = CharUpper("abcdefg")

RB範例:

檢視原始碼 REALBasic
1
2
3
4
5
6
7
8
9
'RB的宣告
Declare Function CharUpper Lib "user32" Alias "CharUpperA" ( _
	lpsz As CString _
	) As CString
 
Dim rtvl As String
 
'把abcdefg轉大寫
rtvl = CharUpper("abcdefg")

VB.NET範例:

1
2
3
4
5
6
7
8
9
10
11
'VB.NET的宣告
<DllImport("user32.dll")> _
Shared Function CharUpper( _
	ByVal lpsz As String _
	) As String
End Function
 
Dim rtvl As String
 
'把abcdefg轉大寫
rtvl = CharUpper("abcdefg")

C#範例:

1
2
3
4
5
6
7
8
9
10
//C#的宣告
[DllImport("user32")]
public static extern string CharUpper(
	string lpsz
	);
 
string rtvl;
 
//把abcdefg轉大寫
rtvl = CharUpper("abcdefg");

發表迴響