The document discusses the String class in Java. Some key points:
- Strings are immutable sequences of characters that are objects of type String
- The StringBuffer class can be used to modify strings, as it allows changes to the original string
- Common string methods include length(), charAt(), equals(), concat(), and substring()
- Autoboxing and unboxing allow automatic conversion between primitive types and their corresponding wrapper classes like Integer
The document discusses various Java string concepts:
1. Java strings are immutable sequences of characters that are objects of the String class. The StringBuffer class can be used to modify strings.
2. Common string methods include length(), charAt(), compareTo(), concat(), and substring().
3. The StringBuffer class represents mutable strings and defines methods like append(), insert(), delete(), and replace() to modify the string content.
4. Enumerated types in Java can be defined using the enum keyword to represent a fixed set of constants, like the days of the week.
This document discusses strings and string buffers in Java. It defines strings as sequences of characters that are class objects implemented using the String and StringBuffer classes. It provides examples of declaring, initializing, concatenating and using various methods like length(), charAt() etc. on strings. The document also introduces the StringBuffer class for mutable strings and lists some common StringBuffer functions.
The document discusses String handling in Java. It describes how Strings are implemented as objects in Java rather than character arrays. It also summarizes various methods available in the String and StringBuffer classes for string concatenation, character extraction, comparison, modification, and value conversion. These methods allow extracting characters, comparing strings, modifying strings, and converting between string and other data types.
This document discusses strings in C++. It explains that a string is a class that can be thought of as a new type of variable to store text. Strings store characters in an array and functions like length() can return the size. Strings can be concatenated using + or assigned using =. The getline() function reads a whole line of input including whitespace. Dot functions operate on specific string objects.
The document discusses processing strings in Java using the String, StringBuffer, and StringTokenizer classes. It provides details on constructing and manipulating strings, including obtaining length, retrieving characters, concatenation, substrings, comparisons, and conversions. It also covers the StringBuffer class for processing mutable strings, and the StringTokenizer class for extracting tokens from strings. Examples provided demonstrate checking palindromes, counting letters, using StringBuffer for output, and processing command-line arguments.
This document provides an overview of arrays in C#, including:
- Arrays are fixed-length collections that store elements of the same type. They can be one-dimensional or multidimensional.
- Elements are accessed via an index that starts at 0. The Length property returns the array size.
- Common operations include initialization, iteration with for loops and foreach, and passing arrays to methods.
- Strings are objects that can be treated similarly to character arrays. Common string methods include comparison, searching, and manipulation.
- The StringBuilder class provides a mutable alternative to immutable strings for efficient string operations.
This document discusses arrays and StringBuffer class in Java. It defines single and multi-dimensional arrays and provides examples. It also explains the difference between String and StringBuffer classes and lists common methods of StringBuffer class like append(), insert(), reverse() etc. Examples are given to demonstrate the usage of these StringBuffer methods.
Java string , string buffer and wrapper classSimoniShah6
?
The document discusses Java strings and wrapper classes. It provides examples of creating and manipulating strings using the String, StringBuffer, and StringBuilder classes. It also discusses the eight primitive wrapper classes in Java and examples converting between primitive types and their corresponding wrapper classes.
String in programming language in c or c++Azeemaj101
?
This document discusses strings in C++. It defines a string as a sequence of characters and provides examples. It explains that strings can be represented using C-style character arrays or the C++ string class. When using character arrays, strings are null-terminated and common functions like strcpy(), strcat(), and strlen() are used. The C++ string class provides a safer alternative with useful methods like assign(), append(), insert(), replace(), erase(), find(), and more. It also supports all C++ operators and returns the string length.
String literals in python are surrounded by either single quotation marks, or double quotation marks. Strings can be output to screen using the print function. For example: print("hello"). Like many other popular programming languages, strings in Python are arrays of bytes representing unicode characters.
1) A string is a one-dimensional array of characters terminated by a null character. Strings are declared using char arrays or string literals.
2) There are two ways to declare and initialize strings in C: using a char array and specifying the size, or using a string literal which automatically inserts a null terminator.
3) Common string functions include strlen() to return the length, strcpy() to copy one string to another, strcat() to concatenate strings, and strcmp() to compare two strings.
This document discusses string methods in Python. It lists common string methods like capitalize(), upper(), lower(), find(), strip(), startswith(), and count(). It provides examples of how to use each method and what they return. It also discusses parsing strings, like extracting the domain name from an email address by finding the position of '@' and whitespace characters.
The document discusses strings and StringBuffers in Java. Strings are immutable sequences of characters represented by the String class. StringBuffers allow modifying character sequences and are represented by the StringBuffer class. The summary provides an overview of common string and StringBuffer operations like concatenation, extraction, comparison, and modification.
javastringexample problems using string classfedcoordinator
?
Java strings are sequences of characters that are treated as objects. The String class provides methods to create and manipulate strings. Strings are immutable, so the StringBuffer and StringBuilder classes provide mutable alternatives. Key string methods include concat(), equals(), substring(), length(), and indexOf(). The StringBuffer class is synchronized and thread-safe, while the StringBuilder class is non-synchronized and more efficient for single-threaded use.
The document discusses strings in C programming. It defines strings as finite sequences of characters that can be implemented as arrays of bytes or characters. It describes common string operations like searching, sorting, trimming, insertion, and deletion. It also lists various string manipulation functions in C like strcat, strcpy, strlen, and their applications in areas like text editing, search engines, and computational biology.
String is an object that represents a sequence of characters. The three main String classes in Java are String, StringBuffer, and StringTokenizer. String is immutable, while StringBuffer allows contents to be modified. Common string methods include length(), charAt(), substring(), indexOf(), and equals(). The StringBuffer class is similar to String but more flexible as it allows adding, inserting and appending new contents.
Strings in Java are objects of the String class that represent sequences of characters. Strings are immutable, meaning their contents cannot be modified once created. The StringBuffer class represents mutable strings that can be modified by methods like append(), insert(), delete(), and replace(). Some key String methods include length(), charAt(), equals(), concat(), and indexOf(), while common StringBuffer methods allow modifying the string through insertion, deletion, replacement and reversal of characters.
The StringBuffer class represents mutable sequences of characters. It is similar to strings but allows modifications by providing methods like append(), insert(), delete(), and replace(). StringBuffer has a default capacity of 16 characters that is increased automatically when more space is needed to store character sequences. It is used by the compiler to implement string concatenation with the + operator.
The document provides an overview of Strings and StringBuilders in Java. It discusses Strings as immutable objects and how StringBuilders can be more efficient for modifying strings. It also covers common String and StringBuilder methods, when to use each, and exceptions in Java using try/catch blocks.
This document discusses Java strings and provides information about:
1. What strings are in Java and how they are treated as objects of the String class. Strings are immutable.
2. Two ways to create String objects: using string literals or the new keyword.
3. Important string methods like concatenation, comparison, substring, and length; and string classes like StringBuffer and StringBuilder that allow mutability.
This document discusses various string operations in Python including: finding the length of a string; accessing and slicing characters; the difference between strings and lists; converting case; checking character types; splitting strings; finding substrings; reading and printing strings; concatenation and repetition; iterating through strings with for loops; and common string methods like isalpha, isdigit, lower, upper, title, join, split, count, find, index. It also provides examples of problems involving anagrams, pangrams, unique characters, and removing duplicates from strings.
The document discusses the StringBuffer class in Java. Some key points:
- StringBuffer is like String but mutable and growable, used for string concatenation.
- It has methods to append, insert, delete, and modify characters. As characters are added and removed, the StringBuffer will automatically increase capacity if needed.
- Common methods include append(), insert(), delete(), replace(), reverse(), and substring() to modify the character sequence within a StringBuffer.
Most people might think of a water faucet or even the tap on a keg of beer. But in the world of networking, "TAP" stands for "Traffic Access Point" or "Test Access Point." It's not a beverage or a sink fixture, but rather a crucial tool for network monitoring and testing. Khushi Communications is a top vendor in India, providing world-class Network TAP solutions. With their expertise, they help businesses monitor, analyze, and secure their networks efficiently.
More Related Content
Similar to STRING FUNCTIONS IN JAVA BY N SARATH KUMAR (20)
This document provides an overview of arrays in C#, including:
- Arrays are fixed-length collections that store elements of the same type. They can be one-dimensional or multidimensional.
- Elements are accessed via an index that starts at 0. The Length property returns the array size.
- Common operations include initialization, iteration with for loops and foreach, and passing arrays to methods.
- Strings are objects that can be treated similarly to character arrays. Common string methods include comparison, searching, and manipulation.
- The StringBuilder class provides a mutable alternative to immutable strings for efficient string operations.
This document discusses arrays and StringBuffer class in Java. It defines single and multi-dimensional arrays and provides examples. It also explains the difference between String and StringBuffer classes and lists common methods of StringBuffer class like append(), insert(), reverse() etc. Examples are given to demonstrate the usage of these StringBuffer methods.
Java string , string buffer and wrapper classSimoniShah6
?
The document discusses Java strings and wrapper classes. It provides examples of creating and manipulating strings using the String, StringBuffer, and StringBuilder classes. It also discusses the eight primitive wrapper classes in Java and examples converting between primitive types and their corresponding wrapper classes.
String in programming language in c or c++Azeemaj101
?
This document discusses strings in C++. It defines a string as a sequence of characters and provides examples. It explains that strings can be represented using C-style character arrays or the C++ string class. When using character arrays, strings are null-terminated and common functions like strcpy(), strcat(), and strlen() are used. The C++ string class provides a safer alternative with useful methods like assign(), append(), insert(), replace(), erase(), find(), and more. It also supports all C++ operators and returns the string length.
String literals in python are surrounded by either single quotation marks, or double quotation marks. Strings can be output to screen using the print function. For example: print("hello"). Like many other popular programming languages, strings in Python are arrays of bytes representing unicode characters.
1) A string is a one-dimensional array of characters terminated by a null character. Strings are declared using char arrays or string literals.
2) There are two ways to declare and initialize strings in C: using a char array and specifying the size, or using a string literal which automatically inserts a null terminator.
3) Common string functions include strlen() to return the length, strcpy() to copy one string to another, strcat() to concatenate strings, and strcmp() to compare two strings.
This document discusses string methods in Python. It lists common string methods like capitalize(), upper(), lower(), find(), strip(), startswith(), and count(). It provides examples of how to use each method and what they return. It also discusses parsing strings, like extracting the domain name from an email address by finding the position of '@' and whitespace characters.
The document discusses strings and StringBuffers in Java. Strings are immutable sequences of characters represented by the String class. StringBuffers allow modifying character sequences and are represented by the StringBuffer class. The summary provides an overview of common string and StringBuffer operations like concatenation, extraction, comparison, and modification.
javastringexample problems using string classfedcoordinator
?
Java strings are sequences of characters that are treated as objects. The String class provides methods to create and manipulate strings. Strings are immutable, so the StringBuffer and StringBuilder classes provide mutable alternatives. Key string methods include concat(), equals(), substring(), length(), and indexOf(). The StringBuffer class is synchronized and thread-safe, while the StringBuilder class is non-synchronized and more efficient for single-threaded use.
The document discusses strings in C programming. It defines strings as finite sequences of characters that can be implemented as arrays of bytes or characters. It describes common string operations like searching, sorting, trimming, insertion, and deletion. It also lists various string manipulation functions in C like strcat, strcpy, strlen, and their applications in areas like text editing, search engines, and computational biology.
String is an object that represents a sequence of characters. The three main String classes in Java are String, StringBuffer, and StringTokenizer. String is immutable, while StringBuffer allows contents to be modified. Common string methods include length(), charAt(), substring(), indexOf(), and equals(). The StringBuffer class is similar to String but more flexible as it allows adding, inserting and appending new contents.
Strings in Java are objects of the String class that represent sequences of characters. Strings are immutable, meaning their contents cannot be modified once created. The StringBuffer class represents mutable strings that can be modified by methods like append(), insert(), delete(), and replace(). Some key String methods include length(), charAt(), equals(), concat(), and indexOf(), while common StringBuffer methods allow modifying the string through insertion, deletion, replacement and reversal of characters.
The StringBuffer class represents mutable sequences of characters. It is similar to strings but allows modifications by providing methods like append(), insert(), delete(), and replace(). StringBuffer has a default capacity of 16 characters that is increased automatically when more space is needed to store character sequences. It is used by the compiler to implement string concatenation with the + operator.
The document provides an overview of Strings and StringBuilders in Java. It discusses Strings as immutable objects and how StringBuilders can be more efficient for modifying strings. It also covers common String and StringBuilder methods, when to use each, and exceptions in Java using try/catch blocks.
This document discusses Java strings and provides information about:
1. What strings are in Java and how they are treated as objects of the String class. Strings are immutable.
2. Two ways to create String objects: using string literals or the new keyword.
3. Important string methods like concatenation, comparison, substring, and length; and string classes like StringBuffer and StringBuilder that allow mutability.
This document discusses various string operations in Python including: finding the length of a string; accessing and slicing characters; the difference between strings and lists; converting case; checking character types; splitting strings; finding substrings; reading and printing strings; concatenation and repetition; iterating through strings with for loops; and common string methods like isalpha, isdigit, lower, upper, title, join, split, count, find, index. It also provides examples of problems involving anagrams, pangrams, unique characters, and removing duplicates from strings.
The document discusses the StringBuffer class in Java. Some key points:
- StringBuffer is like String but mutable and growable, used for string concatenation.
- It has methods to append, insert, delete, and modify characters. As characters are added and removed, the StringBuffer will automatically increase capacity if needed.
- Common methods include append(), insert(), delete(), replace(), reverse(), and substring() to modify the character sequence within a StringBuffer.
Most people might think of a water faucet or even the tap on a keg of beer. But in the world of networking, "TAP" stands for "Traffic Access Point" or "Test Access Point." It's not a beverage or a sink fixture, but rather a crucial tool for network monitoring and testing. Khushi Communications is a top vendor in India, providing world-class Network TAP solutions. With their expertise, they help businesses monitor, analyze, and secure their networks efficiently.
Elevate your online presence with Malachite Technologies where creativity meets technology. Our web design experts craft visually stunning and interactive websites that not only capture your brand¡¯s essence but also enhance user engagement.
Ricardo Jebb Bruno is a skilled Structural CAD Technician with over 10 years of experience. He specializes in structural analysis, design, and project management, and is proficient in AutoCAD, Revit, and SolidWorks. A graduate of the University of Miami with a degree in Civil Engineering, he currently works at Metrix Structural Group. Ricardo is a member of the American Society of Civil Engineers and the National CAD Society, and volunteers with Habitat for Humanity. His hobbies include 3D printing and sci-fi media.
Build Your Uber Clone App with Advanced FeaturesV3cube
?
Build your own ride-hailing business with our powerful Uber clone app, fully equipped with advanced features to give you a competitive edge. Start your own taxi business today!
More Information : https://www.v3cube.com/uber-clone/
Weekly cyber hits: NK hackers drop BeaverTail via 11 npm pkgs (5.6k dl¡¯s) targeting devs. Ivanti flaw (CVE-2025-22457) hit by China pros¡ªpatch by 4/11! PoisonSeed spams Coinbase; PyPI pkgs (39k dl¡¯s) swipe data. Lock it down! Like & share for more!
Automated Engineering of Domain-Specific Metamorphic Testing EnvironmentsPablo G¨®mez Abajo
?
Context. Testing is essential to improve the correctness of software systems. Metamorphic testing (MT) is an approach especially suited when the system under test lacks oracles, or they are expensive to compute. However, building an MT environment for a particular domain (e.g., cloud simulation, model transformation, machine learning) requires substantial effort.
Objective. Our goal is to facilitate the construction of MT environments for specific domains.
Method. We propose a model-driven engineering approach to automate the construction of MT environments. Starting from a meta-model capturing the domain concepts, and a description of the domain execution environment, our approach produces an MT environment featuring comprehensive support for the MT process. This includes the definition of domain-specific metamorphic relations, their evaluation, detailed reporting of the testing results, and the automated search-based generation of follow-up test cases.
Results. Our method is supported by an extensible platform for Eclipse, called Gotten. We demonstrate its effectiveness by creating an MT environment for simulation-based testing of data centres and comparing with existing tools; its suitability to conduct MT processes by replicating previous experiments; and its generality by building another MT environment for video streaming APIs.
Conclusion. Gotten is the first platform targeted at reducing the development effort of domain-specific MT environments. The environments created with Gotten facilitate the specification of metamorphic relations, their evaluation, and the generation of new test cases.
Mastering Azure Durable Functions - Building Resilient and Scalable WorkflowsCallon Campbell
?
The presentation aims to provide a comprehensive understanding of how Azure Durable Functions can be used to build resilient and scalable workflows in serverless applications. It includes detailed explanations, application patterns, components, and constraints of Durable Functions, along with performance benchmarks and new storage providers.
Benefits of Moving Ellucian Banner to Oracle CloudAstuteBusiness
?
Discover the advantages of migrating Ellucian Banner to Oracle Cloud Infrastructure, including scalability, security, and cost efficiency for educational institutions.
Next.js Development: The Ultimate Solution for High-Performance Web Appsrwinfotech31
?
The key benefits of Next.js development, including blazing-fast performance, enhanced SEO, seamless API and database integration, scalability, and expert support. It showcases how Next.js leverages Server-Side Rendering (SSR), Static Site Generation (SSG), and other advanced technologies to optimize web applications. RW Infotech offers custom solutions, migration services, and 24/7 expert support for seamless Next.js operations. Explore more :- https://www.rwit.io/technologies/next-js
GDG on Campus Monash hosted Info Session to provide details of the Solution Challenge to promote participation and hosted networking activities to help participants find their dream team
Why Outsource Accounting to India A Smart Business Move!.pdfanjelinajones6811
?
Outsource Accounting to India to reduce costs, access skilled professionals, and streamline financial operations. Indian accounting firms offer expert services, advanced technology, and round-the-clock support, making it a smart choice for businesses looking to improve efficiency and focus on growth.
Columbia Weather Systems offers professional weather stations in basically three configurations for industry and government agencies worldwide: Fixed-Base or Fixed-Mount Weather Stations, Portable Weather Stations, and Vehicle-Mounted Weather Stations.
Models include all-in-one sensor configurations as well as modular environmental monitoring systems. Real-time displays include hardware console, WeatherMaster? Software, and a Weather MicroServer? with industrial protocols, web and app monitoring options.
Innovative Weather Monitoring: Trusted by industry and government agencies worldwide. Professional, easy-to-use monitoring options. Customized sensor configurations. One-year warranty with personal technical support. Proven reliability, innovation, and brand recognition for over 45 years.
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]jackalen173
?
Copy This Link and paste in new tab & get Crack File
¡ý
https://hamzapc.com/ddl
Fast Screen Recorder is an incredibly useful app that will let you record your screen and save a video of everything that happens on it.
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-WorldSafe Software
?
Join us for an exclusive webinar featuring special guest speakers from Amazon, Amberside Energy, and Avineon-Tensing as we explore the power of Amazon Bedrock and FME in AI-driven geospatial workflows.
Discover how Avineon-Tensing is using AWS Bedrock to support Amberside Energy in automating image classification and streamlining site reporting. By integrating Bedrock¡¯s generative AI capabilities with FME, image processing and categorization become faster and more efficient, ensuring accurate and organized filing of site imagery. Learn how this approach reduces manual effort, standardizes reporting, and leverages AWS¡¯s secure AI tooling to optimize their workflows.
If you¡¯re looking to enhance geospatial workflows with AI, automate image processing, or simply explore the potential of FME and Bedrock, this webinar is for you!
Smarter RAG Pipelines: Scaling Search with Milvus and FeastZilliz
?
About this webinar
Learn how Milvus and Feast can be used together to scale vector search and easily declare views for retrieval using open source. We¡¯ll demonstrate how to integrate Milvus with Feast to build a customized RAG pipeline.
Topics Covered
- Leverage Feast for dynamic metadata and document storage and retrieval, ensuring that the correct data is always available at inference time
- Learn how to integrate Feast with Milvus to support vector-based retrieval in RAG systems
- Use Milvus for fast, high-dimensional similarity search, enhancing the retrieval phase of your RAG model
Automating Behavior-Driven Development: Boosting Productivity with Template-D...DOCOMO Innovations, Inc.
?
https://bit.ly/4ciP3mZ
We have successfully established our development process for Drupal custom modules, including automated testing using PHPUnit, all managed through our own GitLab CI/CD pipeline. This setup mirrors the automated testing process used by Drupal.org, which was our goal to emulate.
Building on this success, we have taken the next step by learning Behavior-Driven Development (BDD) using Behat. This approach allows us to automate the execution of acceptance tests for our Cloud Orchestration modules. Our upcoming session will provide a thorough explanation of the practical application of Behat, demonstrating how to effectively use this tool to write and execute comprehensive test scenarios.
In this session, we will cover:
1. Introduction to Behavior-Driven Development (BDD):
- Understanding the principles of BDD and its advantages in the software development lifecycle.
- How BDD aligns with agile methodologies and enhances collaboration between developers, testers, and stakeholders.
2. Overview of Behat:
- Introduction to Behat as a testing framework for BDD.
- Key features of Behat and its integration with other tools and platforms.
3. Automating Acceptance Tests:
- Running Behat tests in our GitLab CI/CD pipeline.
- Techniques for ensuring that automated tests are reliable and maintainable.
- Strategies for continuous improvement and scaling the test suite.
4. Template-Based Test Scenario Reusability:
- How to create reusable test scenario templates in Behat.
- Methods for parameterizing test scenarios to enhance reusability and reduce redundancy.
- Practical examples of how to implement and manage these templates within your testing framework.
By the end of the session, attendees will have a comprehensive understanding of how to leverage Behat for BDD in their own projects, particularly within the context of Drupal and cloud orchestration. They will gain practical knowledge on writing and running automated acceptance tests, ultimately enhancing the quality and efficiency of their development processes.
Automating Behavior-Driven Development: Boosting Productivity with Template-D...DOCOMO Innovations, Inc.
?
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
1. STRINGS
Strings represents a sequence of charcters
Ex:
char Name[]= new char[5];
Name[0]=¡®r¡¯
Name[1]=¡®a¡¯
Name[2]=¡®j¡¯
Name[3]=¡®a¡¯
Name[4]=¡®h¡¯
In java strings are class objects implemented by two classes
1. String class and
2. StringBuffer class
String class is used to create strings of fixed length
And StringBuffer class creates strings of flexible length
which can be modified in terms of length and content
2. STRINGS
A java string is an instantiated object of String class
A java string is not a character array and it is not
Null terminated.
A string can be created as follows
String stringname;
stringname = new String(¡°string¡±);
Ex: String collegename;
collegename = new String(¡°Rajah college¡±);
3. STRINGS
Like arrays we can find the length of a string by
using length() method.
Ex:
int length= collegename.length();
length=13
Java strings can be concatenated using ¡°+ ¡° operator
ex:
String strin1=¡°rajah¡±
String string2=¡°college¡±
String string3= string1+string2;
string=¡°rajahcollege¡±
4. SRINGS
String arrays:
We can also creat arrays that contain strings.
String names[]=new String[3];
String methods:
s2=s1.toLowerCase
Converts the string s1 to all lower case
s2=s1.toUpperCase
Convers the string s1 to all Upper case
5. STRINGS
s2=s1.replace(¡®x¡¯ , ¡®y¡¯)
Replaces all the appearance of ¡®x¡¯ with ¡®y¡¯
s2=s1.trim()
Removes the white spaces at the beginning and end
of the string s1.
s1.equals(s2)
Returns true if s1 is equal to s2
s1.equalsIgnoreCase(s2)
Returns true if s1 is equal to s2 by ignoring case
s1.length()
Returns the length of the string s1
6. STRINGS
s1.charAt(n)
It returns the character at positon
s1.compareTo(s2)
Returns true if s1<s2, positive if s1>s2 and zero if
s1=s2
s1.concate(s2)
Concatenates s1 and s2
7. STRINGS
s1.subString(n)
Give s a substring starting from nth character
s1.subString(n,m)
Gives a substring starting from nth character upto mth
not including mth character.
s1.indexOf(¡®x¡¯)
Gives the postion of first appearance of x in string s1
s1.indexOf(¡®x¡¯,n)
Gives the first appearance of ¡®x¡¯ after nth position in
string s1
8. STRINGBUFFER CLASS
StringBuffer class is used to create strings of flexible
length.
Strings that are created by using StringBuffer class
can be modified both in terms of length and content.
Ex:
StringBuffer str= new StringBuffer(¡°object
language¡±)
StringBuffer class methods:
s1.setCharAt(n,¡¯x¡¯)
Modifies the nth character to x.
s1.append(s2)
Appends the string s2 to the end of s1
9. STRINGBUFFER CLASS
s1.insert(n,s2)
Inserts the string s2 at the postion n of the string
s1
s1.setLength(n)
Set the length of the string s1 to n. If n<s1.length()
S1 is truncated. If n>s1.length(). Zeros are added.