PreviousNext…

Tip #2: did you know about StrConv?

Background

Have you ever found yourself doing stuff like this?

varEval = Evaluate("@ProperCase(Subject)", doc)

That's pants that is. Yet a lot of people — myself for quite a while — know nothing about the Lotusscript function statement StrConv. It's there in Designer Help, but seems to be tricky to find, and isn't mentioned in the section on text manipulation.

The function

The reason for the lack of knowledge with regards this function, I think, is because most people are used to LCase and UCase… so when they don't see a "PCase", they assume there's no way of doing such a thing.

The cool thing about this function is that you can perform all kinds of Lotusscript case-related operations on strings with ease. No need for convoluted Evaluate calls… Here's a summary of how StrConv works:

It takes two arguments. The first is the string expression to manipulate, the second is an integer (for ease of use there are constants at work here) which stipulates the conversion operation required. These constants are:

CONSTANTINTEGEROPERATION
SC_UpperCase1Upper case
SC_LowerCase2Lower case
SC_ProperCase3Proper case

But wait! There are some more!

CONSTANTINTEGEROPERATION
SC_Wide4Single byte to double byte
SC_Narrow8Double byte to single byte
SC_Katakana16Hiragana to Katakana
SC_Hiragana32 Katakana to Hiragana

Good eh?

Further reading

Comments on this post are now closed.

About

I’m a software architect / developer / general IT wrangler specialising in web, mobile web and middleware using things like node.js, Java, C#, PHP, HTML5 and more.

Best described as a simpleton, but kindly. You can read more here.

";