Vikyath Ram has Published 138 Articles

How to extract the last n characters from a string using Java?

Vikyath Ram

Vikyath Ram

Updated on 20-Feb-2020 04:47:44

12K+ Views

To extract last n characters, simply print (length-n)th character to nth character using the charAt() method.ExampleLive Demopublic class ExtractingCharactersFromStrings {    public static void main(String args[]) {           String str = "Hi welcome to tutorialspoint";       int n = 5;       int initial = str.length()-5;       for(int i=initial; i

How to count the number characters in a Java string?

Vikyath Ram

Vikyath Ram

Updated on 20-Feb-2020 04:43:25

790 Views

Declare an integer, initialize it with 0, in for loop increment it for each character.ExampleLive Demopublic class Sample {    public static void main(String args[]) {       String str = new String("Hi welcome to Tutorialspoint");       int count = 0;       for(int i = 0; i

How to concatenate two strings using Java?

Vikyath Ram

Vikyath Ram

Updated on 19-Feb-2020 12:50:01

345 Views

You can concatenate two Strings using the concat() method.ExampleLive Demopublic class ConcatinatedStrings {    public static void main(String args[]) {             String str1 = new String("Tutorials");       String str2 = new String( "Point");       String res = str1.concat(str2);       System.out.println(res);    } }OutputTutorialsPoint

How can we add columns with default values to an existing MySQL table?

Vikyath Ram

Vikyath Ram

Updated on 29-Jan-2020 05:42:28

3K+ Views

While adding columns to an existing table with the help of ALTER command we can specify the default value also.SyntaxAlter table table-name ADD (column-name datatype default data);ExampleIn the example below, with the help of ALTER Command, column ‘City’ is added with default value ‘DELHI’ to the table ‘Student’.mysql> Alter table ... Read More

In case of FOREIGN KEY constraint, what kind of relationship is there between MySQL parent and child tables?

Vikyath Ram

Vikyath Ram

Updated on 28-Jan-2020 07:11:41

448 Views

The relationship between parent and child table is One-to-Many relationship. It can be understood with the example of two tables named ‘customer’ and ‘orders’. Here, ‘customer’ is the parent table and ‘orders’ is the child table. The relationship is one-to—many because a customer can have more than one order. It ... Read More

How to set the color of the outline around an element with JavaScript?

Vikyath Ram

Vikyath Ram

Updated on 24-Jan-2020 06:47:38

156 Views

To set the outline color, use the outlineColor property. You can try to run the following code to set the color of the outline around an element with JavaScript:ExampleLive Demo                    #box {             width: ... Read More

Information for obsolete functions in SAP ABAP

Vikyath Ram

Vikyath Ram

Updated on 05-Dec-2019 10:21:38

336 Views

Generally, the information is present in the obsolete function module documentation itself. Here is snapshot of information for “DOWNLOAD” function.

Deleting from temporary table in SAP HANA

Vikyath Ram

Vikyath Ram

Updated on 05-Dec-2019 09:42:28

967 Views

The temporary tables are session specific. So you would require to use truncate instead of delete as followstruncate table #temptable;Also, could you please check your release? In the recent releases, delete also works fine. Here is an example:Drop table #temptable; Create local temporary table #temptable(id integer, str nvarchar(30)); Insert into ... Read More

Call screen on clicking the button in SAP ABAP

Vikyath Ram

Vikyath Ram

Updated on 05-Dec-2019 09:17:37

3K+ Views

Please follow the steps below to make it functional.First, open the screen painterNow, double click on the button you want to make functionalAbove “Context Menu Form", you will find a field to enter Functional code where you enter the functional code.This will convert your button to functional trigger theOK code ... Read More

Merging 2 tables with similar column name SAP HANA database

Vikyath Ram

Vikyath Ram

Updated on 05-Dec-2019 09:11:29

541 Views

This can be done by using UNION or UNION ALL operator as followsselect id, Empl_name, DeptId from table1 union select id, Empl_name, DeptId from table2 The difference between UNION and UNION ALL is that UNION removes the duplicates while UNION ALL shows duplicates as well.

Previous 1 ... 6 7 8 9 10 ... 14 Next
Advertisements