-
option explicit
private sub form_click()
dim s as string, i as integer, flag as boolean
s = "this is a book."
s = lcase(s)
print s
flag = true
for i = 1 to len(s) 'Start the loop, the number of loops is the length of s.
if mid(s, i, 1) = " " then 'If 1 character in position ith in the s string is a space.
flag = true 'Set the mark as true.
elseif flag then 'Otherwise (if the character in that i position is not a space) and the b tag is true.
Change the s string to take the i-1 character on the left side of the s, plus the uppercase letter of the judgment character, plus the character of length -1 on the right (that is, the character becomes uppercase, and the other characters remain unchanged).
flag = false 'The tag is set to false.
end if
next i}
print s
end sub
-
What it does is convert words in a string to the first letter.
The ** in curly braces, its working idea is:
Loop through each character, and if it's a space, set the flag to true.
This tag is used to indicate whether the last processed character was a space or not. If the previous character is a space, the currently processed character is capitalized, and the flag is false.
One of the problems with this paragraph is that if you encounter an even number of spaces in a row, you can't convert the subsequent word to the first word uppercase.
-
The answer you gave yourself is a) 21
Master 2 key points:
1. The rules of operation of the operator symbol.
2,for i = 1 to 20 step 2 The rule of this cycle.
The solution is as follows: 1. The operation rules of the operator symbol.
The notation is to calculate the quotient within the range of integers for two integers, regardless of remainders, e.g
When I first started learning division in elementary school, I had not yet been exposed to decimals and fractions, so the teacher explained that the quotient remainder.
Then in the VB there is:
Special note: 2, for i = 1 to 20 step 2 The rule of this cycle.
Usually i is called the loop control variable, 1 is called the initial value of the cycle, 20 is called the end of the cycle, and 2 is called the step size.
For loops with positive step sizes, the loop termination value is based on the value of the loop variable > (note: if the step size is negative, then the loop termination value is based on the value of the loop variable < loop termination) is the condition for terminating the loop.
1st: i = 1;x=x+i\5 --x = 5 + 1 \ 5 --x = 5
2nd: i = 3;x=x+i\5 --x = 5 + 3 \ 5 --x = 5
3rd: i = 5;x=x+i\5 --x = 5 + 5 \ 5 --x = 6
4th: i = 7;x=x+i\5 --x = 6 + 7 \ 5 --x = 7
5th: i = 9;x=x+i\5 --x = 7 + 9 \ 5 --x = 8
6th: i = 11;x=x+i\5 --x = 8 + 11 \ 5 --x = 10
7th: i = 13;x=x+i\5 --x =10 +13 \ 5 --x = 12
8th: i = 15;x=x+i\5 --x =12 +15 \ 5 --x = 15
9th: i = 17;x=x+i\5 --x =15 +17 \ 5 --x = 18
10th: i = 19;x=x+i\5 --x =18 +19 \ 5 --x = 21
11th: i = 21, at this time i > 20, so the loop is not executed, the second is the end of the loop.
So the value of x is 21
Public opinion events are set into the system in the form of event keywords for a specific emergency event (data may be obtained through public opinion monitoring), such as TOOM public opinion, and the event keywords are sent to the data center, and according to the feedback event network evaluation data, the online evaluation trend of the event development stage is displayed, the impact of the event development is paid attention to, and relevant response strategies are formulated in time to prevent further fermentation of the event.
Because the volume is equal, so when he says density, he means that the mass of B is greater than that of A. >>>More
At the moment of closing, the transistor is turned on, the C pole has a current through, L1 and L2 form a step-up transformer, and the L2 coil has a high-voltage pulse output. However, the switch cannot be closed continuously, and if it is closed continuously, there will be no high-voltage output. It should be constantly turned on, off, on, off, on, off.
1.When the noun a is modified by another noun b, even if b is plural, a is generally singular. The exception to this is man and woman, and when the modified noun b is plural, they should also be written as plural, as in the example you gave. >>>More
Private international law mainly resolves the conflict of laws between different countries. >>>More