Hi All,
One basic question what the difference between function Trim() and Trimleadingtrailing()..I hope both do the same job.
Thanks,
Gowri
Difference between Trim() and TrimLeadingTrailing()
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 42
- Joined: Wed Dec 26, 2012 1:13 pm
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Trim() can do the job of TrimLeadingTrailing() however vice-versa is not true.
TrimLeadingTrailing() will remove leading and trailing spaces. However Trim() without any specifier will remove leading and trailing spaces along with redundant spaces within the string.
The syntax for Trim() is trim(<string>,<trim char>, <trim option>)
Trim has a few options and by default D is used and space is used by default for trim char. If option B is selected then it will remove leading and trailing characters. Please refer the manual for more details.
TrimLeadingTrailing() will remove leading and trailing spaces. However Trim() without any specifier will remove leading and trailing spaces along with redundant spaces within the string.
The syntax for Trim() is trim(<string>,<trim char>, <trim option>)
Trim has a few options and by default D is used and space is used by default for trim char. If option B is selected then it will remove leading and trailing characters. Please refer the manual for more details.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Genius may have its limitations, but stupidity is not thus handicapped.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In summary, they will behave differently on strings such as
TrimLeadingTrailing() will produce
Trim() with no other arguments will produce
Code: Select all
" HERMAN MUNSTER "
Code: Select all
"HERMAN MUNSTER"
Code: Select all
"HERMAN MUNSTER"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Or...
Code: Select all
" 1313 Mockingbird Lane "
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: