Search This Blog

Sunday, August 7, 2022

Check Whether number is Palindrome or Not using Mule4 Dataweave code

 Code:

Palindrome:

%dw 2.0
output application/json
var a = 4
---
if((a as String == (a as String)[-1 to 0])) "palindromeNumber " else "notPalindromeNumber"




NotPalindrome:

%dw 2.0
output application/json
var a = 56
---
if((a as String == (a as String)[-1 to 0])) "palindromeNumber " else "notPalindromeNumber"



No comments:

Post a Comment