Wednesday 30 November 2016

How to determine the string type (Numeric, AlphaNumeric, etc.) in Salesforce

Introduction

Salesforce provides new string methods to determine what type of characters contains in a particular string by using some of the below methods.

Methods to Determine Character Types

Alpha

  1. String str = 'AlphaOnly';
  2. System.assertEquals(true, str.isAlpha());

The above string method will return true, if the string contain only characters.

isAlphaSpace

  1. String str = 'AlphaOnly Space';
  2. System.assertEquals(true, str.isAlphaSpace());

The above string method will return true, if the string contain alphabet and white spaces.

isAlphaNumeric

  1. String str = 'AlphaNumeric123';
  2. System.assertEquals(true, str.isAlphaNumeric());

The above string method will return true, if the string contain alphabet, numbers.

isAlphanumericSpace

  1. String str = 'Alpha Numeric123';
  2. System.assertEquals(true, str.isAlphanumericSpace());

The above string method will return true, if the string contain alphabet, numbers and white spaces.

isNumeric

  1. String str = '432';
  2. System.assertEquals(true, str.isNumeric());

The above string method will return true, if the string contain numbers only.

isNumericSpace

  1. String str = '432 ';
  2. System.assertEquals(true, str.isNumericSpace());

The above string method will return true, if the string contain numbers with spaces.

isWhitespace

  1. String str = ' ';
  2. System.assertEquals(true, str.isWhitespace());

The above string method will return true, if the string contain only white spaces.

18 comments:

  1. Thanks for sharing this information. Would be very helpful in the exam. I took Salesforce Developer Certification course from E-Learnify.in. They were really helpful in clearing my doubts.

    ReplyDelete
  2. thank you for sharing such a unique information.very glad to leave a comment here.we appriciate your support.one of the recommanded blog in Sales force

    Sales force online training in hyderabad
    Sales force online training

    ReplyDelete
  3. Wow nice blog very great information you given thanks for sharing. Know more about our salesforce Admin & Developer Training

    ReplyDelete
  4. I really appreciate for your efforts to make things easy to understand. I was really many students struggling to understand certain concepts but you made it clear and help me bring back my confidence.

    Hadoop online training
    Hadoop online training in hyderabad
    Hadoop online training in usa
    Hadoop training in hyderabad

    ReplyDelete
  5. This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again.

    Digital Marketing Company in India

    ReplyDelete
  6. Hai Author Good Information that i found here,do not stop sharing and Please keep updating us..... Thanks

    ReplyDelete
  7. Hiiii...Thank you so much for sharing Great information....Nice post....Keep move on....
    Best Salesforce Training in Hyderabad

    ReplyDelete
  8. Thank you for sharing this useful article with us. This blog is a very helpful to me in future. Keep sharing informative articles with us.

    https://www.ahmedabadcomputereducation.com/course/laravel-training-course/

    ReplyDelete
  9. Thank you for sharing this useful article. This blog is a very helpful to me. Keep sharing informative articles with us.

    https://www.ahmedabadcomputereducation.com/course/ionic-training-course/

    ReplyDelete
  10. Great sources for knowledge. Thank you for sharing this helpful article. It is very useful for me.

    https://www.ahmedabadcomputereducation.com/course/laravel-training-course/

    ReplyDelete
  11. Awesome content for reading as well as knowledge. Thank you for sharing this informative article with us.

    https://www.sdsfin.in/about-us/

    ReplyDelete
  12. Out of 10 every 8 people in the world has been suffered from severe attack of back pain during their life time. Back pain is a symptoms rather than disease. Doctor finds out the cause of back pain and treats accordingly. Back pain is pain felt in the back that usually originates from the muscles, nerves, bones, joints or other structures in the spine.

    WHAT ARE CAUSES OF BACK PAIN?
    There are many causes of back pain. Long standing degeneration (wearing away) of the vertebrae and the intervertebral disc is the primary cause behind this disorder.

    Back Pain Treatment in Ahmedabad

    ReplyDelete
  13. Thank You for sharing this informative article.

    https://web30india.com/

    ReplyDelete

  14. I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting.







    ReplyDelete
  15. This blog is very informative. For more
    information visit: https://www.hirededicatedresources.com/

    ReplyDelete
  16. QUICK EASY EMERGENCY URGENT LOANS LOAN OFFER EVERYONE APPLY NOW +918929509036 financialserviceoffer876@gmail.com Dr. James Eric

    ReplyDelete

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...