I have an activity to query customer address from the database and then write it into word. The data from my database are all in upper case, for example :
NORTH STREET VIII BLOCK C
I am using this expression to make it into propercase :
and this is the result I got :
North Street Viii Block C
The problem is, the roman numerals are converted into proper case too when the value should be VIII instead Viii. Is there any way to make the robot read if(address_street) contains roman numerals between 1-100 then replace it with proper numerals writing? I’m thinking of using dictionary but I don’t know how to make the robot read the roman numerals, or is there any better solution for it?
Simply, we can convert word consists of I,V,X,L and C to upper case, as the following.
However this also converts word except roman numerals such as “Civic”, “Xi” etc. to upper.
If you cannot accept this limitation, need to consider more strict condition. (It might be necessary to create list of 100 pattern of roman numerals)
Unfortunately it’s not gonna work because there’s another data containing Honda Vehicle like you mentioned (CIVIC, CRV, etc). So I can assume the solution given are not gonna work. But one thing I notice is the “yourString”
let’s say I put the yourString variable is address_street. Will the variable that store the vehicle data (let’s call it strVehicle) will be replaced into Upper case too? Thanks
If “yourString” variable contains only address_street part and convert it using the above expression, it doesn’t affect to strVehicle.
The matter might be how to split to these items properly, I think.
Ok that’s the #1 possibility. #2 possibility, if the address_street variable contains letter I,V,X,L,C, it will converted into uppercase too right?
The above expression converts word consists of only I,V,X,L,C to upper. For example “iv” is converted to “IV” but" iva" is not converted.
Ok I tried this and it’s working. Thank you very much ! Let me try another test case to make it more sure
FYI, according to the following, we might be able to write it more strict.
Can you try the following? This supports up to 4000.
Okay I understand this more. So it’s more accurate to the Romans Numeral and it will make the romans into Uppercase. 4000 is more than enough, thanks !!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.