Показать сообщение отдельно
Старый 08.12.2011, 16:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,486 / 846 (79) +++++++
Регистрация: 28.10.2006
daxdilip: Tip str2CapitalWord function to convert string into TitleCase
Источник: http://feedproxy.google.com/~r/blogs...o-convert.html
==============
Tip str2CapitalWord function to convert string into TitleCase
We have some custom export routines written in our solution which ftp's .csv file from AX. Now, the target system needed one of the column names in TitleCase.

Solution:
In my previous experience, I have used strUpr and strLwr functions in AX, but never had a requirement to convert something into TitleCase, Initially, for a quick workaround, I used Proper function in Excel to convert the column into TitleCase. But, the right way to fix was in the source program. so as soon as I got some time did bit of digging in AX standard functions and found out we have 2 functions:

1. str2Capital

This function just converts the first letter of the word as UpperCase so didn't match my requirements e.g.

Input String : "new south wales"

Output String: print str2Capital("new south wales") returns New south wales


2. str2CapitalWord

This function was exactly what I was looking for. It converts the first letter of each word in the sentence to
uppercase.

Input String: "new south wales"

Output String: "New South Wales"



Источник: http://feedproxy.google.com/~r/blogs...o-convert.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Последний раз редактировалось Poleax; 08.12.2011 в 23:37.