---
schema_version: "1"
id: 5763cecfdf45cbaf35d5c68a4fa17abb8f75d50ae5cb09741a8f86e9ed245f63
title: last (最後)
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.4/dw-strings-functions-last.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.4/dw-strings-functions-last
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 05289a1d4906c2fd90cc4d7bebabde09acc6feb4db5d5e6417da51ad4144a898
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
# last (最後)

## [](#last1)last(text: String, amount: Number): String

文字列の末尾から指定された文字数までの文字 (たとえば、文字列内の最後の 2 文字) までの文字を返します。

_DataWeave バージョン 2.4.0 で導入されました。_​

### [](#パラメーター)パラメーター

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 25%;">
<col style="width: 75%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">名前</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>text</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">処理する文字列。</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>amount</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">返す文字の数。負の数と ​<code>0</code>​ では空の文字列が返されます。小数は最も近い整数に切り上げられます。</p></td>
</tr>
</tbody>
</table>

### [](#例)例

次の例では、文字列内の最後の 6 文字を返します。

#### [](#ソース)ソース

```DataWeave
%dw 2.0
import last from dw::core::Strings
output application/json
---
"hello world!" last 6
```

#### [](#出力)出力

```Json
"world!"
```

## [](#last2)last(text: Null, amount: Any): Null

`last`​ を ​`null`​ 値に使用できるようにするヘルパー関数。

_DataWeave バージョン 2.4.0 で導入されました。_​