Answers for "find first and last character of java string"

8

get first character of string java

var string = "freeCodecamp";

string.charAt(0); // Returns "f"
Posted by: Guest on December-14-2019
0

Get the First and Last Word from a String or Sentence

DECLARE @Sentence    VARCHAR(MAX) = 'The quick brown fox jumps over the lazy dog'

SELECT SUBSTRING(@Sentence, 1, CHARINDEX(' ', @Sentence) - 1) AS [First Word],
       REVERSE(SUBSTRING(REVERSE(@Sentence), 1,                CHARINDEX(' ', REVERSE(@Sentence)) - 1)) AS [Last Word]
Posted by: Guest on April-30-2021

Code answers related to "find first and last character of java string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language