AllBusiness.com
    • Starting a Business
    • Career
    • Sales & Marketing
    • AI
    • Finance & Fundraising
    • M & A
    • Tech
    • Business Resources
    • Business Directory
    1. Home»
    2. Barrons Dictionary»
    3. string operations»

    Definition of string operations

    Dictionary of Computer and Internet Terms: string operations
    string operations

    operations that are performed on character string data. Here are some examples from Java, where A represents the string "GEORGE" and B represents "WASHINGTON"

    1. Compare two strings to see if they are the same. For example,A.equals(B)
      (in other programming languages, A==B or A=B) will be false.
    2. Determine if one string comes before the other in alphabetical order. For example,
      A. compareTo(B)<=0
      will be true (because GEORGE comes before WASHINGTON). In other programming languages this is expressed as Asee Unicode).
    3. Join strings together (concatenation). For example,
      A+" "+B
      is
      "GEORGE WASHINGTON"
      created by joining A, a blank, and B.
    4. Calculate the length of a string. For example, A.length () is 6.
    5. Select specified characters from any position in string. For example,
      B.substring(4,7)
      is the string "ING". The 4 means to start at character 4, which is the character I since the first character (W) is character 0. The 7 means to include all characters up to (but not including) character 7 (which is T).
    6. Determine if one string is contained in another string, and if so, at what position it starts. For example,
      A.indexOf("OR")
      is 2, since OR starts at character 2 of GEORGE (recall that the first character is character 0). However,
      B.indexOf("AND")
      is -1 since the string AND does not occur within the string WASHINGTON.
    7. Determine the Unicode value for an individual character. For example, if C is a character variable, then (short) C
      will give its Unicode value. Here short is a type of integer variable.
    8. Determine the character associated with a given Unicode value. For example, if K is an integer variable, then
      (char)K
      is the character associated with that value.
    9. Determine the numerical value of a string that represents a number. Here are two example for integers and strings):
      String x="234";
      int z=Integer.parseInt(x);
      String x2="234.567";
      double z2=(Double.valueOf(x2)).doubleValue();
      Note the capitalization needs to be exactly as shown.
    10. Convert a numeric value into a string. For example,
      String x=String.valueOf(567);
      will cause x to become the string "567".

    Search for definitions

    BizBuySell
    logo
    AllBusiness.com is a premier business website dedicated to providing entrepreneurs, business owners, and business professionals with articles, insights, actionable advice,
    and cutting-edge guides and resources. Covering a wide range of topics, from starting a business, fundraising, sales and marketing, and leadership, to emerging AI
    technologies and industry trends, AllBusiness.com empowers professionals with the knowledge they need to succeed.
    About UsContact UsExpert AuthorsGuest PostEmail NewsletterAdvertiseCookiesIntellectual PropertyTerms of UsePrivacy Policy
    Copyright © AliBusiness.com All Rights Reserved.
    logo
    • Experts
      • Latest Expert Articles
      • Expert Bios
      • Become an Expert
      • Become a Contributor
    • Starting a Business
      • Home-Based Business
      • Online Business
      • Franchising
      • Buying a Business
      • Selling a Business
      • Starting a Business
    • AI
    • Sales & Marketing
      • Advertising, Marketing & PR
      • Customer Service
      • E-Commerce
      • Pricing and Merchandising
      • Sales
      • Content Marketing
      • Search Engine Marketing
      • Search Engine Optimization
      • Social Media
    • Finance & Fundraising
      • Angel and Venture Funding
      • Accounting and Budgeting
      • Business Planning
      • Financing & Credit
      • Insurance & Risk Management
      • Legal
      • Taxes
      • Personal Finance
    • Technology
      • Apps
      • Cloud Computing
      • Hardware
      • Internet
      • Mobile
      • Security
      • Software
      • SOHO & Home Businesses
      • Office Technology
    • Career
      • Company Culture
      • Compensation & Benefits
      • Employee Evaluations
      • Health & Safety
      • Hiring & Firing
      • Women in Business
      • Outsourcing
      • Your Career
      • Operations
      • Mergers and Acquisitions
    • Operations
    • Mergers & Acquisitions
    • Business Resources
      • AI Dictionary
      • Forms and Agreements
      • Guides
      • Company Profiles
        • Business Directory
        • Create a Profile
        • Sample Profile
      • Business Terms Dictionary
      • Personal Finance Dictionary
      • Slideshows
      • Entrepreneur Profiles
      • Product Reviews
      • Video
    • About Us
      • Create Company Profile
      • Advertise
      • Email Newsletter
      • Contact Us
      • About Us
      • Terms of Use
      • Contribute Content
      • Intellectual Property
      • Privacy
      • Cookies