StrLCase / StrUCase
f90VB Modules
f90VBDefs, f90VBBStrings
Summary
Subroutines StrUCase and StrLCase convert the content of the passed string to uppercase or lowercase.
Syntax
| subroutine StrUCase | (Str, iRet) |
| { | |
| character(len=*),intent(inout):: | Str | |
| integer(OLECHAR_KIND),dimension(:),intent(inout):: | Str | |
| type(OLESTRING),intent(inout):: | Str | |
| integer(BSTRHNDL_KIND),intent(inout):: | Str |
| } | |
| integer(HRESULT_KIND),intent(out),optional:: | iRet |
Arguments
Str [Input/Output]
String whose content should be converted to uppercase or lowercase. Str can be any of the f90VB string types (Fortran Strings, Fixed OLE Strings, Fortran OLE Strings or BStrings).
iRet [Output, Optional]
Upon return, iRet contains the number of characters converted to uppercase or lowercase, or BSTRINGS_ERROR if the procedure failed.
Comments
StrUCase converts all lowercase letters in Str into uppercase, according to the current locale. Other characters are not affected. StrLCase converts all uppercase letters in Str into lowercase. The conversion is done in place for Fortran Strings and Fixed OLE Strings, but may result in reallocation of Str for Fortran OLE Strings and BStrings.
Examples
| program StrUCaseExamples |
!Demonstrates the use of StrUCase and StrLCase
!Copyright 1999, Canaima Software
!All rights reserved
!load f90VB modules
use f90VBDefs
use f90VBBStrings
implicit none
integer(BSTRHNDL_KIND)::Bstr
integer(HRESULT_KIND)::iRet
character(len=25)::FStr
BStr=BStrAlloc('MiXed CaSe STRing')
call StrCopy(BStr,FStr)
print *,'Original BString:',trim(Fstr)
print *,'String length:', StrLenTrim(Bstr)
print *,''
call StrUCase(Bstr,iRet)
call StrCopy(BStr,FStr)
print *,'Uppercase BString:',trim(Fstr)
print *,'Characters converted:', iRet
call StrLCase(Bstr,iRet)
call StrCopy(BStr,FStr)
print *,'Lowercase BString:',trim(Fstr)
print *,'Characters converted:', iRet
stop
end
Related Topics
| For information about | See | |
| Extracting a sub string from a f90VB string | StrSub | |
| Creating a new BString | StrCopy, BStrAlloc | |
| Creating a new Fortran OLE String | StrCopy, OLEStrAlloc | |
| Changing the content of a BString | BStrReAlloc, StrCopy | |
| Concatenating two f90VB strings | StrConcat | |