In SAP Business Connector 4.6 I have tags and fields with
“surplus” of empty spaces which I want to remove. How I can
do that?
Number of empty spaces is dynamic. Tag names are dynamic.
example:
I have:
One thing I did for that is to convert your document to an XML string and parse it to remove the desired charaters. Once the necessary work is done reload it in your record.
Iam Currently Using WM:Public:String.trim function in our developemnt but the Strange thing is it trim frist and last spaces only what happend to the middle spaces. for Example Iam giving input to the string like “Raj kanth” my desire output is “Rajkanth” but it is coming as it is.
other than Java custom code any alternative Solution and One more question why trim is taking first and last spaces only.
Thanks in Advance
Regards
Sreekanth
Without using a Java service , the alternate way is to create a flow service to remove spaces in the input string. The logic to be put is pretty simple. You find the length of the string and you start from the first character till last character.Unless and until you find a space keep pushing each character to a temporary output variable and if you find a space discard it.