I have input like this:
This is, ,,, *&% a ::; demo + String. +Need to**@!/// format:::::!!! this.`
Output Required:
ThisisademoStringNeedtoformatthis
I have to do this without using str_trim.
Edit: I am writing an encryption program. I have to remove all punctuation from the string and turn all lower case letters to uppercase before I encrypt it.
I added the code. I need to remove the spaces, or any punctuation before I turn it to upper case. So far I haven't found anything in my book that could help with this except str_trim which we aren't allowed to use.
INCLUDE Irvine32.inc
.data
source byte "This is the source string",0
.code
main proc
mov esi,0 ; index register
mov ecx,SIZEOF source ; loop counter
L1:
mov al,source[esi] ; get a character from source
and source[esi], 11011111b ; convert lower case to upper case
inc esi ; move to next character
loop L1 ; repeat for entire string
mov edx, OFFSET source
call WriteString
exit
main endp
end main
See Question&Answers more detail:os