@@ -1392,6 +1392,84 @@ void strTrimFunction() throws ExecutionException, InterruptedException {
13921392 System .out .println (result .getResults ());
13931393 }
13941394
1395+ void strLTrimFunction () throws ExecutionException , InterruptedException {
1396+ // [START ltrim_function]
1397+ Pipeline .Snapshot result =
1398+ firestore
1399+ .pipeline ()
1400+ .collection ("books" )
1401+ .select (ltrim (field ("name" )).as ("ltrimmedName" ))
1402+ .execute ()
1403+ .get ();
1404+ // [END ltrim_function]
1405+ System .out .println (result .getResults ());
1406+ }
1407+
1408+ void strRTrimFunction () throws ExecutionException , InterruptedException {
1409+ // [START rtrim_function]
1410+ Pipeline .Snapshot result =
1411+ firestore
1412+ .pipeline ()
1413+ .collection ("books" )
1414+ .select (rtrim (field ("name" )).as ("rtrimmedName" ))
1415+ .execute ()
1416+ .get ();
1417+ // [END rtrim_function]
1418+ System .out .println (result .getResults ());
1419+ }
1420+
1421+ void strRepeatFunction () throws ExecutionException , InterruptedException {
1422+ // [START string_repeat_function]
1423+ Pipeline .Snapshot result =
1424+ firestore
1425+ .pipeline ()
1426+ .collection ("books" )
1427+ .select (stringRepeat (field ("title" ), 2 ).as ("repeatedTitle" ))
1428+ .execute ()
1429+ .get ();
1430+ // [END string_repeat_function]
1431+ System .out .println (result .getResults ());
1432+ }
1433+
1434+ void strReplaceAllFunction () throws ExecutionException , InterruptedException {
1435+ // [START string_replace_all_function]
1436+ Pipeline .Snapshot result =
1437+ firestore
1438+ .pipeline ()
1439+ .collection ("books" )
1440+ .select (stringReplaceAll (field ("title" ), "The" , "A" ).as ("replacedTitle" ))
1441+ .execute ()
1442+ .get ();
1443+ // [END string_replace_all_function]
1444+ System .out .println (result .getResults ());
1445+ }
1446+
1447+ void strReplaceOneFunction () throws ExecutionException , InterruptedException {
1448+ // [START string_replace_one_function]
1449+ Pipeline .Snapshot result =
1450+ firestore
1451+ .pipeline ()
1452+ .collection ("books" )
1453+ .select (stringReplaceOne (field ("title" ), "The" , "A" ).as ("replacedTitle" ))
1454+ .execute ()
1455+ .get ();
1456+ // [END string_replace_one_function]
1457+ System .out .println (result .getResults ());
1458+ }
1459+
1460+ void strIndexOfFunction () throws ExecutionException , InterruptedException {
1461+ // [START string_index_of_function]
1462+ Pipeline .Snapshot result =
1463+ firestore
1464+ .pipeline ()
1465+ .collection ("books" )
1466+ .select (stringIndexOf (field ("title" ), "The" ).as ("indexOfThe" ))
1467+ .execute ()
1468+ .get ();
1469+ // [END string_index_of_function]
1470+ System .out .println (result .getResults ());
1471+ }
1472+
13951473 void unixMicrosToTimestampFunction () throws ExecutionException , InterruptedException {
13961474 // [START unix_micros_timestamp]
13971475 Pipeline .Snapshot result =
0 commit comments